Previous | Home | Next |
WSDL is extensible that allow description of endpoints and their messages regardless of what the message formats is. Following are the elements of Web Service Description Language:
Message: The XML based definition in WSDL consists of message. It is an abstract definition of the data.
Example
<message name="HelloRequest"> <part name="name" type="xsd:string"/> </message> <message name="HelloResponse"> <part name="john" type="xsd:string"/> </message>
Binding: This element defines port type. It is also called a data format for definning the messages. This element describes how the web service is accessed over the network.
Example
<definitions .... > <binding name="booktoken" type="book-name"> <operation name="booktoken"> <input name="booktoken"? > </input> <output name="booktoken"? > </output> <fault name="booktoken"> </fault> </operation> </binding> </definitions>
PortType: A set of operations supported by one or more endpoints.For example collections of operations for binding element or binding message, such as naming a method, message business process. These collections of operations are called as Interfaces.
Example
<portType name="WebServiceInterface"> <operation name="Add"> <input message="y:AddOperation"/> <output message="y:ResponseOperation"/> </operation> <operation name="Multiply"> <input message="y:MultiplyOperation"/> <output message="y:ResponseOperation"/> </operation> </portType>
Types: The types element contains data types that exchanged data between the client and the web service.
Example
<types> <xs:schema xmlns:xs= "http://www.indo.org/XMLSchema" targetNamespace= "http://go.com/ServicePage/schema" xmlns= "http://go.com/ServicePage/schema"> <xs:element name="Request" type="typeRequest"/> <xs:sequence> <xs:element name="date" type="xs:date"/> </xs:sequence> <xs:element name="Response" type="xs:string"/> <xs:element name="DateError" type="xs:string"/> </xs:schema> </types>
Service: The service element contains a URL to the service. For example http://www.go.com/Hello/.
Example
<definitions xmlns="http://www.indo.org/ns/wsdl" xmlns:wsoap="http://www.indo.org/ns/wsdl/soap" xmlns:sch = "http://go.com/ServicePage/schema" targetNamespace= "http://go.com/ServicePage" xmlns:y="http://example.org/CoreJava/" xmlns:ns="http://example.org/origin/" > <service name="CoreJavaService"> <port name="CoreJavaEndpoint" binding="y:CoreJavaSoapHttpBinding"> <soap:address location="http://localhost/r4r.co.in"/> </port> </service> </definitions>
Previous | Home | Next |