Поделиться через


Client-Side Data Flow (Windows Embedded CE 6.0)

1/6/2010

The user application sends a message to the SoapClient object using the ISoapClient interface. Developers interact with the SoapClient object solely through the ISoapClient interface.

The message sent by the user is an operation; in this example, the operation is adding two numbers, as follows:

  1. The SoapClient object processes this request and formulates a SOAP request to the server.
  2. The server receives the request and performs the requested operation.
  3. The server sends the result of the operation back to the client in the form of a SOAP response.
  4. The SoapClient object processes this SOAP response and sends a message that contains the result of the operation back to the user application.

The following diagram illustrates how SOAP handles data flow on the client.

Ee486184.9a933235-3989-4d55-b9b8-ed498310c3b6(en-US,WinEmbedded.60).gif

Setting Up the SoapClient Object

Before sending operation requests using the ISoapClient interface, the user application must first instantiate the SoapClient object that implements this interface. The SoapClient object is implemented in MSSOAP1.dll.

Upon instantiating the SoapClient object, the user application initializes the object by calling ISoapClient::mssoapinit and passing in the following parameters:

  • The name of the Web Services Description Language (WSDL) file.
  • The service name.
  • The port information. A port specifies a binding to a specific communications link used to send the SOAP message. The <portType> element ties the port to a collection of operations.

Internally, all methods described in the WSDL file are bound dynamically to the ISoapClient interface during initialization. This dynamic binding allows you to call any method described in the WSDL file.

Processing Inside the SoapClient Object

The SoapClient and SoapServer objects (the latter of which is accessed using the ISoapServer interface) are considered part of high-level API.

In your application, you use the ISoapClient interface to send SOAP requests; then the SoapClient object does several things internally to send the request to the server.

The following diagram illustrates how the SoapClient object processes the operation request from the user application, formulates a SOAP request message, and processes a SOAP response message.

Ee486184.92a834ad-7955-4426-b716-ea420e996023(en-US,WinEmbedded.60).gif

Here is what happens:

  1. The WSDLReader object loads the WSDL and Web Services Meta Language (WSML) files into a DOM and then analyzes these files.
  2. Based on this analysis, the WSDLReader object creates a WSDLOperation object for the requested operation (for example, AddNum(3, 4)).
  3. The WSDLOperation object calls the WSDLOperation::GetOperationParts method, which returns from the DOM tree a collection of the parts defined for the operation's input and output messages.
  4. The SoapClient object creates SoapMapper objects for each part and loads the values specified in the operation request into these objects.
  5. The SoapSerializer object (accessed through the ISoapSerializer interface) builds the SOAP request message from the appropriate SoapMapper objects and sends it to the server.
  6. The server processes the SOAP request and returns a SOAP response to the client. From this response, the SoapClient object loads the result of the operation into the appropriate SoapMapper object and returns the result to the user application.

The WSDLReader and WSDLOperation objects are considered part of the SOAP Toolkit low-level API. Instead of using the ISoapClient high-level API, you can use the low-level API in your application.

For more information about high-level and low-level APIs, see the Calc sample applications described in SOAP Samples.

See Also

Concepts

SOAP Application Development
Server-Side Data Flow
A Quick Introduction to WSDL
A Quick Introduction to WSML
SOAP Samples