Tutorials to .com

Tutorials to .com » Jsp » Xml » WSDL in the Web Service in the meaning and role of

WSDL in the Web Service in the meaning and role of

Print View , by: iSee ,Total views: 8 ,Word Count: 902 ,Date: Mon, 20 Apr 2009 Time: 12:32 AM

<!--[ if! supportLists] -> 1. <!--[ Endif] -> WSDL

<!--[ if! supportLists] -> a) <!--[ endif] -> Principle: From XML-RPC and SOAP use we can see that the request message are based on service provider's service interface to generate an HTTP request, the request package to which the method call, as well as at the time of method call parameters.

Client service call to complete the task of code that is provided by the use of the realization of the interface to a statement calling the method need to name and parameters, and then by the realization of the user's input in accordance with combination of HTTP requests.

This process can be described, first of all, access to user input, and then enter into the realization of the required storage format, and then into the HTTP request format. Under normal circumstances, we need to manually complete the second step, but obviously this process can be automated, he, the effect of automation is that users no longer need to write this part of the code, reduce the workload and reduce the error probability.

The process of automation is needed to participate in the WSDL, the service he provided a description of its services, call in accordance with this description service will be able to know the number of required parameters, and then to the user request. Been input, the realization of the request based on WSDL to the input into a specific storage format, or a direct HTTP request to generate the final.

For each service, WSDL need to describe the contents of two parts, one interface, and the other is to achieve. Service interface description format, such as service name, service parameters, service results. Services are described, corresponding to the user to provide input into how to achieve compliance with a particular form of agreement, under normal circumstances, we use SOAP as a means of achieving an agreement, then the client analyzes the WSDL document in the future will be to user input We have seen into the SOAP request over, followed the process with exactly the same as before.

<!--[ if! supportLists] -> 2. <!--[ endif] -> WSDL examples <!--[ if! supportLists] -> a) <!--[ endif] -> Introduction Part I: to be specified below, the use of data types and message types .

<? xml version = "1.0" encoding = "UTF-8"?>

<wsdl: definitions name = "HelloWorldDescription"

targetNamespace = "urn: HelloWorld" xmlns: tns = "urn: HelloWorld"

xmlns: soap = http://schemas.xmlsoap.org/wsdl/soap/

xmlns: wsdl = "http://schemas.xmlsoap.org/wsdl/">

<wsdl:message name="sayHello_IN">

<part name="name" type="xsd:string" />

</ wsdl: message>

<wsdl:message name="sayHello_Out">

<part name="greeting" type="xsd:string" />

</ wsdl: message>

<!--[ if! supportLists] -> b) <!--[ endif] -> Service Interface: Description of the method name, and input and output parameters.

<wsdl:portType name="HelloWorldInterface">

<wsdl:operation name="sayHello">

<wsdl:input message="tns:sayHello_IN" />

<wsdl:output message="tns:sayHello_OUT" />

</ wsdl: operation>

</ wsdl: portType>

<!--[ if! supportLists] -> c) <!--[ endif] -> services: description of a service interface to convert the SOAP request.

<wsdl:binding name="HelloWorldBinding" type="tns:HelloWorldInterface">

<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>

<wsdl:operation name="sayHello">

<soap:operation soapAction="urn:Hello" />


<soap: body use = "encoded" namespace = "urn: Hello"

encodingStyle = http://schemas.xmlsoap.org/soap/encoding//>

</ wsdl: input>


<soap: body use = "encoded" namespace = "urn: Hello"

encodingStyle = http://schemas.xmlsoap.org/soap/encoding//>

</ wsdl: output>

</ wsdl: operation>

</ wsdl: binding>

<!--[ if! supportLists] -> d) <!--[ endif] -> Service Location: Specify the SOAP request to send the destination.

<wsdl:service name="HelloWorldService">

<wsdl:port name="HelloWorldPort" binding="tns:HelloWorldBinding">

<soap:address location="http://localhost:8080" />

</ wsdl: port>

</ wsdl: service>

</ wsdl: definitions>

Java and XML Articles

Can't Find What You're Looking For?

Rating: Not yet rated


No comments posted.