November 12, 2001 - The WSDL's service Element
November 12, 2001 The WSDL's service Element Tips: November 2001
Yehuda Shiran, Ph.D.
|
service
element defines the ports supported by the Web service. For each of the supported protocols, there is one port
element. The service
element is a collection of ports. Here is a SOAP port from the Temperature -- Weather Web service:
<service name="TemperatureService">
<documentation>Returns current temperature in a given U.S. zipcode</documentation>
<port name="TemperaturePort" binding="tns:TemperatureBinding">
<soap:address location="https://services.xmethods.net:80/soap/servlet/rpcrouter" />
</port>
</service>
The binding
attributes associate the address of the service with a binding
element defined in the Web service. In this case, this is the TemperatureBinding
binding
:
<binding name="TemperatureBinding" type="tns:TemperaturePortType">
<soap:binding style="rpc" transport="https://schemas.xmlsoap.org/soap/http" />
<operation name="getTemp">
<soap:operation soapAction="" />
<input>
<soap:body use="encoded" namespace="urn:xmethods-Temperature"
encodingStyle="https://schemas.xmlsoap.org/soap/encoding/" />
</input>
<output>
<soap:body use="encoded" namespace="urn:xmethods-Temperature"
encodingStyle="https://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
</binding>
Web service clients can learn from the service
element where to access the service, through which port to access the Web service, and how the communication messages are defined.