WSDL: Difference between revisions
Example
(Adding...) |
(Example) |
||
Line 79: | Line 79: | ||
==Example== | ==Example== | ||
To illustrate the above here is a sample of a very simple service WSDL | To illustrate the above here is a sample of a very simple service WSDL... start from the '''''service''''' element at the bottom and work up through the various elements to the types definitions: | ||
<?xml version="1.0" encoding="UTF-8" ?> | <?xml version="1.0" encoding="UTF-8" ?> | ||
Line 88: | Line 86: | ||
xmlns:soap="<nowiki>http://schemas.xmlsoap.org/wsdl/soap/</nowiki>" | xmlns:soap="<nowiki>http://schemas.xmlsoap.org/wsdl/soap/</nowiki>" | ||
xmlns:tns="<nowiki>http://unicorninterglobal.com/sample/" | xmlns:tns="<nowiki>http://unicorninterglobal.com/sample/" | ||
name="Hello" | |||
targetNamespace="http://unicorninterglobal.com/sample/</nowiki>"> | |||
<types> | |||
<xs:schema elementFormDefault="qualified" targetNamespace="<nowiki>http://unicorninterglobal.com/sample/</nowiki>"> | <xs:schema elementFormDefault="qualified" targetNamespace="<nowiki>http://unicorninterglobal.com/sample/</nowiki>"> | ||
<xs:element name="SayHello"> | <xs:element name="'''SayHello'''"> <span style="color:red">--link from input message</span> | ||
<xs:complexType> | <xs:complexType> | ||
<xs:sequence> | <xs:sequence> | ||
<xs:element name="sName" type="xs:string" /> | <xs:element name="sName" type="xs:string" /> <span style="color:red">--and in the end it is just a string!</span> | ||
</xs:sequence> | </xs:sequence> | ||
</xs:complexType> | </xs:complexType> | ||
</xs:element> | </xs:element> | ||
<xs:element name="SayHelloResponse"> | <xs:element name="'''SayHelloResponse'''"> <span style="color:red">--link from output message</span> | ||
<xs:complexType> | <xs:complexType> | ||
<xs:sequence> | <xs:sequence> | ||
<xs:element name="SayHelloResult" type="xs:string" /> | <xs:element name="SayHelloResult" type="xs:string" /> <span style="color:red">--and so it this one!</span> | ||
</xs:sequence> | </xs:sequence> | ||
</xs:complexType> | </xs:complexType> | ||
Line 108: | Line 107: | ||
</xs:schema> | </xs:schema> | ||
</types> | </types> | ||
<message name="SayHelloSoapRequest"> | |||
<part name="parameters" element="tns:SayHello" /> | <message name="'''SayHelloSoapRequest'''"> <span style="color:red">--link from portType</span> | ||
<part name="parameters" element="'''tns:SayHello'''" /> <span style="color:red">--link to type definition</span> | |||
</message> | </message> | ||
<message name="SayHelloSoapResponse"> | |||
<part name="parameters" element="tns:SayHelloResponse" /> | <message name="'''SayHelloSoapResponse'''"> <span style="color:red">--link from portType</span> | ||
<part name="parameters" element="'''tns:SayHelloResponse'''" /> <span style="color:red">--link to type definition</span> | |||
</message> | </message> | ||
<portType name="HelloSoapType"> | |||
<portType name="'''HelloSoapType'''"> <span style="color:red">--link from binding</span> | |||
<operation name="SayHello"> | <operation name="SayHello"> | ||
<documentation>This operation says 'Hello!'</documentation> | <documentation>This operation says 'Hello!'</documentation> | ||
<input message="tns:SayHelloSoapRequest" /> | <input message="'''tns:SayHelloSoapRequest'''" /> <span style="color:red">--link to message</span> | ||
<output message="tns:SayHelloSoapResponse" /> | <output message="'''tns:SayHelloSoapResponse'''" /> <span style="color:red">--link to message</span> | ||
</operation> | </operation> | ||
</portType> | </portType> | ||
<binding name="HelloSoapBinding" type="tns:HelloSoapType"> | |||
<binding name="'''HelloSoapBinding'''" type="'''tns:HelloSoapType'''"> <span style="color:red">--links ''from'' service and ''to'' portType</span> | |||
<soap:binding style="document" transport="<nowiki>http://schemas.xmlsoap.org/soap/http</nowiki>" /> | <soap:binding style="document" transport="<nowiki>http://schemas.xmlsoap.org/soap/http</nowiki>" /> | ||
<operation name="SayHello"> | <operation name="SayHello"> | ||
Line 129: | Line 132: | ||
</input> | </input> | ||
<output> | <output> | ||
<soap:body use="literal" /> | <soap:body use="literal" /> | ||
</output> | </output> | ||
</operation> | </operation> | ||
</binding> | </binding> | ||
<service name="Hello"> | <service name="Hello"> | ||
<documentation>Sample | <documentation>Sample documentation for the service</documentation> <span style="color:red">--from psDocumentation</span> | ||
<port name="HelloSoap" binding="tns:HelloSoapBinding"> | <port name="HelloSoap" binding="'''tns:HelloSoapBinding'''"> <span style="color:red">--connects to the "binding" element</span> | ||
<soap:address location="<nowiki>http:// | <soap:address location="<nowiki>http://www.sample.com/services/Hello.wso</nowiki>" /> <span style="color:red">--service endpoint URI</span> | ||
</port> | </port> | ||
</service> | </service> | ||
[[Category: Web Services | [[Category: Web Services]] |