Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple-port Service Defined in a WSDL

A different question, with the essential problem. At the end of my WSDL file.

<wsdl:service name="Lighting">
    <wsdl:port name="SwitchPower" binding="tns:SwitchPower">
        <soap:address location="http://localhost:8080/Lighting/SwitchPower/" />
    </wsdl:port>
    <wsdl:port name="Dimming" binding="tns:Dimming">
        <soap:address location="http://localhost:8080/Lighting/Dimming/" />
    </wsdl:port>
</wsdl:service>

The same service with two ports. Is it right?

If no, what are the rules of the specification?

like image 833
user2021023 Avatar asked Apr 08 '13 14:04

user2021023


2 Answers

  • Each port refers unique binding (can have multiple bindings)
  • Each binding can refer single portType
  • Multiple binding can refer same portType or different portType (can have multiple portTypes)
  • So, when we have multiple portTypes, we publishes multiple ports by referring bindings.
    enter image description here

img courtesy

like image 135
Premraj Avatar answered Nov 27 '22 14:11

Premraj


Yes. Imagine in real life, this is indeed possible:

A Shipping Dock: The Idea of a Multi-Port Service

enter image description here

Please refer to Section 2.7 of the W3 WSDL Specification. You can see that the * signifies you can have multiple ports under a service. In fact, a service groups a set of related ports together. There are several points to note though.

Section 2.7 of the W3 WSDL Specification

A service groups a set of related ports together:

<wsdl:definitions .... >
    <wsdl:service name="nmtoken"> *
        <wsdl:port .... />*
    </wsdl:service>
</wsdl:definitions>

The name attribute provides a unique name among all services defined within in the enclosing WSDL document.

Ports within a service have the following relationship:

  • None of the ports communicate with each other (e.g. the output of one port is not the input of another).
  • If a service has several ports that share a port type, but employ different bindings or addresses, the ports are alternatives. Each port provides semantically equivalent behavior (within the transport and message format limitations imposed by each binding). This allows a consumer of a WSDL document to choose particular port(s) to communicate with based on some criteria (protocol, distance, etc.).
  • By examining its ports, we can determine a service's port types. This allows a consumer of a WSDL document to determine if it wishes to communicate to a particular service based whether or not it supports several port types. This is useful if there is some implied relationship between the operations of the port types, and that the entire set of port types must be present in order to accomplish a particular task.
like image 23
Jops Avatar answered Nov 27 '22 14:11

Jops