Sunday, 18 October 2015

What are different elements in WSDL?





















Types : 
<types>
<xsd:schema>
<xsd:import namespace="http://provider.soap.frog.it.com/" schemaLocation="http://localhost:5555/spring-mvc-app/frogDataProvider?xsd=1"/>
</xsd:schema>
</types>

<xs:schema xmlns:tns="http://provider.soap.frog.it.com/" 
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"
targetNamespace="http://provider.soap.frog.it.com/">
<xs:element name="findFrogs" type="tns:findFrogs"/>
<xs:element name="findFrogsResponse" type="tns:findFrogsResponse"/>
<xs:element name="uploadFrog" type="tns:uploadFrog"/>
<xs:element name="uploadFrogResponse" type="tns:uploadFrogResponse"/>
<xs:complexType name="uploadFrog">
<xs:sequence>
<xs:element name="arg0" type="tns:frog" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="frog">
<xs:sequence>
<xs:element name="age" type="xs:int"/>
<xs:element name="breed" type="xs:string" minOccurs="0"/>
<xs:element name="color" type="xs:string" minOccurs="0"/>
<xs:element name="email" type="xs:string" minOccurs="0"/>
<xs:element name="fid" type="xs:string" minOccurs="0"/>
<xs:element name="name" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

types - describes the data exchage in the soap web service
This can come only once in WSDL



Second Element of WSDL
<message name="findFrogs">
<part name="parameters" element="tns:findFrogs"/>
</message>

message describes the input and output for the soap based web service.....
message can appear one or more times in WSDL...


portType -Elements describes operations exposed in soap web service
this can appear one or more times.

<portType name="FrogDataProvider">
<operation name="findFrogs">
<input wsam:Action="http://provider.soap.frog.it.com/FrogDataProvider/findFrogsRequest" message="tns:findFrogs"/>
<output wsam:Action="http://provider.soap.frog.it.com/FrogDataProvider/findFrogsResponse" message="tns:findFrogsResponse"/>
</operation>
<operation name="uploadFrog">
<input wsam:Action="http://provider.soap.frog.it.com/FrogDataProvider/uploadFrogRequest" message="tns:uploadFrog"/>
<output wsam:Action="http://provider.soap.frog.it.com/FrogDataProvider/uploadFrogResponse" message="tns:uploadFrogResponse"/>
</operation>
</portType>


operation - operation is similar to method in java
which is child element of PortType and operation element can appear one or more 
times in WSDL.

binding  :-

<binding name="FrogDataProviderPortBinding" type="tns:FrogDataProvider">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="findFrogs">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="uploadFrog">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>

1. It describes the protocol used in soap web service.
2. it also describes structure of soap message based on 
    style and use 

Binding tag can appear one or more times....


##############################################################
-------------------------------------------------------------------------------------
Service Tag (FrogDataProviderService)


this web service name to access the web service 

<service name="FrogDataProviderService">
<port name="FrogDataProviderPort" binding="tns:FrogDataProviderPortBinding">
<soap:address location="http://localhost:5555/spring-mvc-app/frogDataProvider"/>
</port>
</service>

This service tag only appears one time in WSDL

.................................................


Port Element in WSDL
1. it gives you physical location of web service
2. It describes which binding is used in web service
3. It can appear one or more times.

<port name="FrogDataProviderPort" binding="tns:FrogDataProviderPortBinding">
<soap:address location="http://localhost:5555/spring-mvc-app/frogDataProvider"/>
</port>




No comments:

Post a Comment