Web service

 
 
Web services are web based applications that use open, XML-based standards and transport protocol designed to support interoperable machine-to-machine interaction over a network.







Explain WSDL version 1.1



The Web Services Description Language (WSDL) is an XML-based language that provides a model for describing web services.

More information about the WSDL specification, see http://www.w3.org/TR/wsdl
Note: WSDL 1.1 is not the latest version.


Information

Example WSDL 1.1 document
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?xml version="1.0"?>
<definitions name="StockQuote"
   targetNamespace="http://example.com/stockquote.wsdl"
   xmlns:tns="http://example.com/stockquote.wsdl"
   xmlns:xsd1="http://example.com/stockquote.xsd"
   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
   xmlns="http://schemas.xmlsoap.org/wsdl/">

   <types>
      <schema targetNamespace="http://example.com/stockquote.xsd"
         xmlns="http://www.w3.org/2000/10/XMLSchema">
         <element name="TradePriceRequest">
            <complexType>
               <all>
                  <element name="tickerSymbol" type="string"/>
               </all>
            </complexType>
         </element>
         <element name="TradePrice">
            <complexType>
               <all>
                  <element name="price" type="float"/>
               </all>
            </complexType>
         </element>
      </schema>
   </types>

   <message name="GetLastTradePriceInput">
      <part name="body" element="xsd1:TradePriceRequest"/>
   </message>

   <message name="GetLastTradePriceOutput">
      <part name="body" element="xsd1:TradePrice"/>
   </message>

   <portType name="StockQuotePortType">
      <operation name="GetLastTradePrice">
         <input message="tns:GetLastTradePriceInput"/>
         <output message="tns:GetLastTradePriceOutput"/>
      </operation>
   </portType>

   <binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="GetLastTradePrice">
         <soap:operation soapAction="http://example.com/GetLastTradePrice"/>
            <input>
               <soap:body use="literal"/>
            </input>
            <output>
               <soap:body use="literal"/>
            </output>
      </operation>
   </binding>

   <service name="StockQuoteService">
      <documentation>My first service</documentation>
      <port name="StockQuotePort" binding="tns:StockQuoteBinding">
         <soap:address location="http://example.com/stockquote"/>
      </port>
   </service>

</definitions>




#Description
02 The mandatory Envelope is the root element of the SOAP message.
03 The xmlns:soap namespace should always have the value of: "http://www.w3.org/2003/05/soap-envelope/,
and defines the Envelope as a SOAP Envelope. If a different or no namespace is used, the application generates an error and discards the SOAP message.

Note: The choice of any namespace prefix "xmlns:soap" is arbitrary and not semantically significant.
04 The Envelope element may have the following attribute and defines how a recipient should process the SOAP message.
  • encodingStyle (See Header element for explanantion)
07 The optional Header element is encoded as the first immediate child element of the Envelope element and contains application specific information (like authentication, payment, etc) about the SOAP message.

The Header element may have the following attributes:
  • encodingStyle
    The encodingStyle attribute defines the data types in the SOAP message which can be used to serialize or deserialize the SOAP message. A SOAP message has no default encoding.
  • role
    Is used to indicate the SOAP node to which a particular SOAP header block is targeted
  • mustUnderstand
    Is used to indicate whether the processing of a SOAP header block is mandatory or optional and has the value of "false" or "0", "true" or "1". If this attribute is omitted, mustUnderstand is considered "false".
  • relay
    Is used to indicate whether a SOAP header block targeted at a SOAP receiver must be relayed if not processed and has the value of "false" or "0", "true" or "1". If this attribute is omitted, relay is considered "false".
08 All immediate child elements of the Header element must be namespace qualified, for example: xmlns:n="http://www.mobilefish.com/ws/ac"
xmlns:t="http://www.mobilefish.com/ws/tx"
17 The mandatory Body element contains information intended for the ultimate recipient of the message.

Immediate child elements of the SOAP Body element should be namespace-qualified.
22 The optional Fault element is used to carry error information within a SOAP message. If present, the SOAP Fault element MUST appear as a body entry and MUST NOT appear more than once within a Body element. The Fault element has two or more child elements in order as follows:
  • Code (mandatory)
    The Code element contains two elements:
    • Value (mandatory)
      SOAP defines a small set of SOAP fault codes covering high level SOAP faults:
      • VersionMismatch
        Found an invalid namespace for the SOAP Envelope element.
      • MustUnderstand
        An immediate child element of the Header element, with the mustUnderstand attribute set to "1", was not understood.
      • DataEncodingUnknown
        A SOAP header block or SOAP body child element information item targeted at the faulting SOAP node is scoped with a data encoding that the faulting node does not support.
      • Sender
        The message was incorrectly formed or did not contain the appropriate information in order to succeed. For example, the message could lack the proper authentication or payment information. It is generally an indication that the message is not to be resent without change.
      • Receiver
        The message could not be processed for reasons attributable to the processing of the message rather than to the contents of the message itself. For example, processing could include communicating with an upstream SOAP node, which did not respond. The message could succeed if resent at a later point in time.
    • Subcode (optional)
      The Subcode element contains two elements:
      • Value (mandatory)
        The value of this element is an application defined subcategory of the value of the Value child element information item of the Subcode element information item's parent element information item.
      • Subcode (optional)
  • Reason (mandatory)
    Is intended to provide a human-readable explanation of the fault.
  • Node (optional)
    The Node element information item is intended to provide information about which SOAP node on the SOAP message path caused the fault to happen.
  • Role (optional)
    The Role element information item identifies the role the node was operating in at the point the fault occurred. The value of the Role element information item MUST be one of the roles assumed by the node during processing of the message.
  • Detail(optional)
    The Detail element information item is intended for carrying application specific error information.