A WSDL contract defines the following Web Service information –
Example
[sourcecode lang=”xml”] <?xml version="1.0" encoding="UTF-8" standalone="no"?><wsdl:import location="Errors.wsdl" namespace="http://glenware.com/Errors" />
<wsdl:types>
<xsd:schema>
<xsd:import
namespace="http://glenware.com/webservice/WSDLExampleApplication"
schemaLocation="../schema/WSDLExampleApplication.xsd" />
</xsd:schema>
</wsdl:types>
<wsdl:message name="getMyDetailsRequest">
<wsdl:part name="request" element="tns:getMyDetailsRequest"></wsdl:part>
</wsdl:message>
<wsdl:message name="getMyDetailsResponse">
<wsdl:part name="response" element="tns:getMyDetailsResponse"></wsdl:part>
</wsdl:message>
<wsdl:portType name="WSDLExampleApplicationPort">
<wsdl:operation name="getMyDetails">
<wsdl:input message="tns:getMyDetailsRequest"></wsdl:input>
<wsdl:output message="tns:getMyDetailsResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="WSDLExampleApplicationBinding" type="tns:WSDLExampleApplicationPort">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="getMyDetails">
<soap:operation
soapAction="http://glenware.com/webservice/WSDLExampleApplication/getMyDetails"
style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="WSDLExampleApplication">
<wsdl:port binding="tns:WSDLExampleApplicationBinding" name="WSDLExampleApplicationPort">
<soap:address location="http://localhost:8181/cxf/webservice/WSDLExampleApplication" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
[/sourcecode]
This shows the two parts of the wsdl –
The datatypes are defined in the external “../schema/WSDLExampleApplication.xsd” – this allows types to be shared amongst wsdl’s. This follows standard schema rules –
> Support for simple types (xsd:string, xsd:int, xsd:long, …)
> Support for complex types –