Israel Railways Gadget Wsdl and Soap

SOAP and WSDL

SOAP

SOAP- Simple Object Access Protocol.
SOAP is a protocol for exchanging xml-based messages over the internet. Normally, it is implemented over HTTP. There are many patterns for SOAP messages, but the most common is RPC- Remote Procedure Call. SOAP enables to both client and server to organize their data in an xml-based way. This property is the one that makes web-services platform-independent. A basic soap message looks like this-

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetStations xmlns="http://tempuri.org/">
<SystemId>string</SystemId>
<systemUserName>string</systemUserName>
<Password>string</Password>
</GetStations>
</soap:Body>
</soap:Envelope>

This is an example of a soap message that we send to the railway's web service. It starts as a regular xml file, and then defines an envelope, which is the main element of the message. Inside the message there can be a title (optional) and a body that represents the data sent in the message.

WSDL

WSDL- Web Service Description Language.
WSDL is an xml-based language for describing web services. Suppose a web server provides a service, clients should know how to access and consume it. An intuitive way to do that could be a document with explanations about the service. However, the problem is that no computer can understand such a specification. WSDL is a formal language, with which a web-service provider defines which services are available, and how to use them. WSDL specification includes the types of messages that client can send to the server. These message are exactly the SOAP messages.

Another important role of the WSDL is the way of creating the connection between the client and the server. WSDL contains details about the server's IP adderss, the port number of the service, etc. Using that details, the client can connect to the server and send him requests.

One more role of a WSDL specification is to exactly describe the functions of the service. WSDL contains the names of available methods, and the parameters that should be delivered to the server when calling the methods. In addition, it includes the structure of the SOAP message that the server suppose to return.

Here is an example of the WSDL specification of RJPA, the gadget's web service:

<?xml version="1.0" encoding="utf-8" ?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<s:element name="GetStations">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="SystemId" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="systemUserName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetStationsResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetStationsResult">
<s:complexType mixed="true">
<s:sequence>
<s:any />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="GetStationsSoapIn">
<wsdl:part name="parameters" element="tns:GetStations" />
</wsdl:message>
<wsdl:message name="GetStationsSoapOut">
<wsdl:part name="parameters" element="tns:GetStationsResponse" />
</wsdl:message>
<wsdl:portType name="WsGetStationsSoap">
<wsdl:operation name="GetStations">
<wsdl:input message="tns:GetStationsSoapIn" />
<wsdl:output message="tns:GetStationsSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="WsGetStationsSoap" type="tns:WsGetStationsSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="GetStations">
<soap:operation soapAction="http://tempuri.org/GetStations" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="WsGetStationsSoap12" type="tns:WsGetStationsSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="GetStations">
<soap12:operation soapAction="http://tempuri.org/GetStations" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="WsGetStations">
<wsdl:port name="WsGetStationsSoap" binding="tns:WsGetStationsSoap">
<soap:address location="http://62.219.198.24/RJPA/WebServices/WsGetStations.asmx" />
</wsdl:port>
<wsdl:port name="WsGetStationsSoap12" binding="tns:WsGetStationsSoap12">
<soap12:address location="http://62.219.198.24/RJPA/WebServices/WsGetStations.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

Back to Development Information

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License