WSDL Service Element

  • The <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.
  • 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.
  • The service element includes a documentation element to provide human-readable documentation.

Here is a piece of code from Example Session:

<service name="HelloWorld_Service">
      <documentation>WSDL File for HelloWorldService</documentation>
      <port binding="tns:HelloWorld_Binding" name="HelloWorld_Port">
         <soap:address
            location="https://www.dineshonjava.com/SayHelloWorld/">
      </port>
   </service>

The binding attributes of por element associate the address of the service with a binding element defined in the Web service. In this example this is HelloWorld_Binding

<binding name="HelloWorld_Binding" type="tns:HelloWorld_PortType">
   <soap:binding style="rpc"
      transport="http://schemas.xmlsoap.org/soap/http"/>
   <operation name="sayHelloWorld">
      <soap:operation soapAction="sayHelloWorld"/>
      <input>
         <soap:body
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
            namespace="urn:examples:helloworldservice"
            use="encoded"/>
      </input>
      <output>
         <soap:body
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
            namespace="urn:dineshonjava:helloworldservice"
            use="encoded"/>
      </output>
   </operation>
   </binding>

References
Wikipedia for WSDL

 

<<Previous <<   || Index ||   >>Next >>
Previous
Next