Discuss this help topic in SecureBlackbox Forum

SOAP: Send SOAP message with SOAP client

Prepare for sending

To send a previously created or loaded SOAP message using TElXMLSOAPClient component you need to setup the following properties:

Optionally you can also set OperationResponseName and OperationResponseNamespaceURI properties to help the component know what the name of operation response is, and ExpectedResponseType property to let the component know what response data type is expected. After that you need to call TElXMLSOAPClient.SendMessage() or TElXMLSOAPClient.SendMessageWithAttachment() method to send the SOAP message.

Send and receive results

SendMessage() method does the following:

  1. saves the XML document, which contains SOAP message, using the encoding pecified in Encoding property, and sends it to the service URL using the HTTP client referenced in HTTPClient property. If any error occurs on the request stage, exception is thrown and the HTTPStatusCode property is set to zero value.
  2. After receiving the response the component sets HTTPStatusCode property to the value, received from the server, and puts response data to ResponseStream property.
  3. Depending on the value of ExpectedResponseType property the component tries to parse the response stream as an XML document and places the result to ResponseXMLDocument property, then it tries to load SOAP message from this XML document and puts it to ResponseSOAPMessage property.
  4. If any errors occurs on parsing stage, an exception is thrown and HTTPStatusCode property is set to non-zero value (as we have received response from the server). ResponseType property is set to the value, that indeicates, what parsing stages, described above, were successful and what properties have been initialized.
  5. Finally the component loads response parameters or faults from the SOAP message and puts them to ResponseParameterCount, ResponseParameters[] and FaultCount, Faults[] properties.

How To articles about SOAP client

Discuss this help topic in SecureBlackbox Forum