This section provides a brief summary of the programming models used in SOAP messaging using SAAJ.
A SOAP message is sent to an endpoint by way of a point-to-point connection (implemented by the SOAPConnection class).
You use point-to-point connections to establish a request-reply messaging model. The request-reply model is illustrated in Figure 5–6.
Using this model, the client does the following:
Creates an endpoint that specifies the URL that will be passed to the SOAPConnection.call method that sends the message.
See Endpoint for a discussion of the different ways of creating an endpoint.
Creates a SOAPConnection factory and obtains a SOAP connection.
Creates a message factory and uses it to create a SOAP message.
Creates a name for the content of the message and adds the content to the message.
Uses the SOAPConnection.call method to send the message.
It is assumed that the client will ignore the SOAPMessage object returned by the call method because the only reason this object is returned is to unblock the client.
The SOAP service listening for a request-reply message uses a ReqRespListener object to receive messages.
For a detailed example of a client that does point-to-point messaging, see Writing a SOAP Client.