A service element is a collection of related ports and a port defines an individual network endpoint by specifying a single address for a binding.
The first “port” element’s definition in the service element is shown below in Fig 9.
- <port name="FlightServiceSoap" binding="s0:FlightServiceSoap">
<soap:address location="http://webservices.scandinavian.net/flightstatus/flightservice.asmx" />
</port>
Fig 9: port element definition.
As we can see, the port contains the URL (the network endpoint) of the Web Service and also has a reference to the binding element as an attribute.
So a port = binding + network address
With this background information about the “port”, let us take a look at the “service” element:
Fig 10: service element definition.
As shown in the Fig 10, a service is a collection of related but mutually exclusive ports. Which means that all the three ports belong to the same service but none of them really communicate with each other. Also all these related ports provide semantically equivalent behavior by allowing Web Service consumers to choose a particular port to communicate with the Web Service based on protocol implementation or some other criteria.
With this background, now we understand the Web Service contract spelled in WSDL. To summarize our understanding, we can define the SAS Flight Status Web Service contract in plain English as below:
SAS Flight Status Web Service
? ? Accepts two input parameters (of type “int”)
? ? Returns one parameter (of type “string”)
? ? Address of the Web Service is: http://webservices.scandinavian.net/flightstatus/flightservice.asmx
? ? Allows us to choose the protocol from SOAP, HTTP-GET and HTTP-POST
With this information, we are ready to move on to “consume” this Web Service!