WebService series Teaching (3)-How to call WebService

Source: Internet
Author: User
Tags soap wsdl
Web 4. How to Invoke WebService
Call procedure for 4.0 WebService
Client: Obtain service-side service description file WSDL, parse the contents of the file, understand service-side service information, and how to invoke it. Generate the appropriate SOAP request message (Specify the invoked method, parameters that have been invoked), and send it to the server, as needed. Waits for the SOAP response message returned by the server to parse the return value.
Server side: Generates a service description file for client access. Receives a SOAP request message from the client, parsing the method invocation and the parameter format. According to the WSDL and WSML descriptions, the corresponding COM object is invoked to complete the specified function and the return value is returned to the user in a SOAP response message.
High-level interface
With high-level interfaces, you can generate and use a webservice without knowing any information about soap and XML. Soap Toolkit 2.0 accomplishes these functions by providing two COM objects ――soapclient and soapserver.
On the client side, only one soapclient instance needs to be generated and the MSSoapInit method is invoked using WSDL as a parameter. The SoapClient object automatically parses the WSDL file and generates the method and parameter information for all Web service internally. After that, you can call all the methods in the same way as you would call the IDispatch interface. In VB or scripting language, you can even add directly to the SoapClient object name. Method (Parameter ...) Make a call.
Low-level interface
To use low-level interfaces, you must have an understanding of soap and XML. You can control the process of soap processing, especially when it comes to special processing.
On the client side, you first create a HttpConnector object that is responsible for the HTTP connection. Set up some connector header information, such as Endpoinurl and SOAPAction. If the network connection needs to use a proxy server, then also set up the relevant information here. The Soapserializer object is then created to generate the SOAP message. According to the WSDL definition, all parameters are serialized sequentially, and a complete SOAP request message is obtained. The SOAP message, as payload, is sent through the HttpConnector to the service side. Finally, a Soapreader object is generated that reads the SOAP message returned by the server and obtains the return value.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.