The process of calling XML Web services is similar to that of calling conventional methods. The main difference between the two is that the former does not call Methods located in the client application, but generates request messages through specified transmission (such as HTTP. Because the XML Web services method may be located on different computers, the information required by XML Web services to process requests must be transmitted over the network to the server that carries XML Web services. After processing the information, XML Web services sends the results to the client application over the network.
The following illustration shows the communication process between the client and XML Web services.
The following describes the sequence of events when XML Web services is called:
- The client creates a new instance for the XML Web services proxy class. This object resides on the client computer.
- The client calls the method on the proxy class.
- The basic structure on the client computer serializes parameters of the XML Web services method into SOAP messages and sends them to XML Web services over the network.
- The infrastructure receives SOAP messages and deserializes XML. It creates an instance that implements the XML Web services class, calls the XML Web services method, and passes in the deserialization XML as the parameter.
- The XML Web services method executes its code and finally sets the return value and all output parameters.
- The infrastructure on the Web server serializes the return value and output parameters into SOAP messages, and then sends them back to the client over the network.
- The XML Web services infrastructure on the client computer will receive SOAP messages, deserialize XML into return values and any output parameters, and pass them to the proxy instance.
- The client receives the return value and all output parameters.
Address: http://msdn.microsoft.com/zh-cn/library/x05s00wz.aspx