Name
SOAPConnection
Synopsis
public abstract class SOAPConnection {
// Public Constructors
public SOAPConnection( );
// Public Instance Methods
public abstract SOAPMessage call(SOAPMessage request, Object to)
throws SOAPException;
public abstract void close( ) throws SOAPException;
}SOAPConnection is an object that can be used to
send SOAP messages. Despite its name, it does not represent a
connection in the traditional sense, since it does not have a fixed
association with a peer object. Instead, it is better thought of as
an access point that can be used to send any number of individually
addressed SOAP messages to arbitrary receivers.
To obtain a SOAPConnection, you need to use a
SOAPConnectionFactory:
SOAPConnectionFactory factory = SOAPConnectionFactory.newInstance; SOAPConnection conn = factory.createConnection;
Both SOAPConnectionFactory and
SOAPConnection are abstract classes, concrete
instances of which are provided by your SAAJ implementation. The fact
that the SOAPConnectionFactory
newInstance( ) method searches for a suitable
implementation class (as described in its reference section in this
chapter) means that you can plug in different SAAJ implementations
without changing your application code. When a
SOAPConnection is no longer required, it should be
released by calling its close( ) method.
The call( ) method takes a
SOAPMessage object, serializes it into XML, and
sends it to the destination given by its to
argument. This argument is declared to be of type
Object, which ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access