WSDL - A Introduction

07.05.2016 Learn @WSO2 Trace
Hey folks, 

I have learn the concept of WSDL - Web Service Definition Language, This is a new way of learning from the comments on the code. I have just write some comment and archive it for the future use.

If you are a cody surely understanding what i have wrote.

Enjoy with this cody! with a cup of Coffee.

Go for Code ....

<!-- It is the place to define and give a name for web service
It is the only one root of the wsdl
The default namesapce is wsdl name sapce others are define when they are need
-->
<definitions name="HelloService"
targetNamespace="http://www.examples.com/wsdl/HelloService.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.examples.com/wsdl/HelloService.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!-- The messge element describe the exchange data between web service provider and the consumer
A web service have two message elements.
1. input : Describe the parameter for the web service
2. output : Describer the return type for the web service.
-->
<message name="SayHelloRequest">
<!-- Each message have zero or more <part> parameters for the web service
Each <part> is for one parameter of the message
Here this use type as Xml Schema defined type, WSDL not strictly typed
-->
<part name="firstName" type="xsd:string"/>
</message>
<message name="SayHelloResponse">
<part name="greeting" type="xsd:string"/>
</message>
<!--
<portType> can combine one request and one response message into a single request/response operation
-->
<portType name="Hello_PortType">
<operation name="sayHello">
<input message="tns:SayHelloRequest"/>
<output message="tns:SayHelloResponse"/>
</operation>
</portType>
<!-- <binding> element giving a detail about how the port type operation is transmitted over the wire.
The bindings can be made available via multiple transports including HTTP GET, HTTP POST, or SOAP.
The biniding should provide concrete information on which protocol is used.
Here we are using SOAP
can specify multiple binding for single Port type
-->
<binding name="Hello_Binding" type="tns:Hello_PortType">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="sayHello">
<soap:operation soapAction="sayHello"/>
<input>
<soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:examples:helloservice"
use="encoded"/>
</input>
<output>
<soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:examples:helloservice"
use="encoded"/>
</output>
</operation>
</binding>
<service name="Hello_Service">
<documentation>WSDL File for HelloService</documentation>
<port binding="tns:Hello_Binding" name="Hello_Port">
<soap:address
location="http://www.wso2.com/SayHello/">
</port>
</service>
</definitions>
<!--
1. One-way : The service only receive a message - The Operation only have single input element.
<wsdl:definitions >
<wsdl:portType >
<wsdl:operation name="nmtoken">
<wsdl:input name="nmtoken"? message="qname"/>
</wsdl:operation>
</wsdl:portType >
</wsdl:definitions>
2. Request Response : The service receive a message and send a response - The Operation have one single input and output element
<wsdl:definitions >
<wsdl:portType >
<wsdl:operation name="nmtoken" parameterOrder="nmtokens">
<wsdl:input name="nmtoken"? message="qname"/>
<wsdl:output name="nmtoken"? message="qname"/>
<wsdl:fault name="nmtoken" message="qname"/>
</wsdl:operation>
</wsdl:portType >
</wsdl:definitions>
3. Solicit- Response : The service sends and recevice a response - like above but additionally for enacaptualate error
additional fault element also specified.
<wsdl:definitions >
<wsdl:portType >
<wsdl:operation name="nmtoken" parameterOrder="nmtokens">
<wsdl:output name="nmtoken"? message="qname"/>
<wsdl:input name="nmtoken"? message="qname"/>
<wsdl:fault name="nmtoken" message="qname"/>
</wsdl:operation>
</wsdl:portType >
</wsdl:definitions>
4. Notification : The service sends a message - Only have out put elements.
<wsdl:definitions >
<wsdl:portType >
<wsdl:operation name="nmtoken">
<wsdl:output name="nmtoken"? message="qname"/>
</wsdl:operation>
</wsdl:portType >
</wsdl:definitions>
-->
-->-->
view raw wsdl.xml hosted with ❤ by GitHub

Comments

Popular posts from this blog

Missionaries & Canibal Problem in AI using Pro Log

Spring Boot - No Need to Restart the Development Server for Each Time