Web Service - Simple Object Access Protocol (SOAP)

About

SOAP (Simple Object Access Protocol) is a Web Services protocol for exchanging:

Soap is also known as XML Rpc.

Concept

The Web service functions are described in a in a WSDL file (Web Services Description Language) that any consumer can read.

The web service procedure is based on the consumer/provider model. A Web service consumer (such as, a desktop application or a Java Platform, Enterprise Edition client such as a portlet) invokes a Web service by submitting a request to a Web service provider. The Web service provider processes the request and returns the result to the Web service consumer.

Webserviceexample

The request and the response are provided in the form of an XML file.

Web Service Request:

<soap:Envelope
  xmlns:n="urn:xmethods-delayed-quotes"
  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <n:getQuote>
       <symbol xsi:type="xs:string">ORCL</symbol>
    </n:getQuote>
  </soap:Body>
</soap:Envelope>

SOAP Response:

<soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    <soap:Body>
       <n:getQuoteResponse xmlns:n="urn:xmethods-delayed-quotes">
         <Result xsi:type="xsd:float">25</Result>
       </n:getQuoteResponse>
  </soap:Body>
</soap:Envelope>

The Web service provider may:

  • ask for credentials to access the service, for example a username and a password.
  • have encrypted the response.

Example

A SOAP message could be sent to a web service enabled web site (for example, a house price database) with the parameters needed for a search. The site would then return an XML-formatted document with the resulting data (prices, location, features, etc).

Example of SOAP request (for OBIEE in order to execute Ibot)

<!-- The SOAP Envelope -->
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v6="urn://oracle.bi.webservices/v6">
   <soapenv:Header/>
   <soapenv:Body>

<!-- The Function to execute with the Parameters path and sessionID -->
      <v6:executeIBotNow>
         <v6:path>?</v6:path>
         <v6:sessionID>?</v6:sessionID>
      </v6:executeIBotNow>

<!-- The end of the SOAP Envelope -->
   </soapenv:Body>
</soapenv:Envelope>

Rely on XML-based file

Web services rely on XML-based industry standards:

  • Extensible Markup Language (XML)—A data format that allows uniform communication between Web services consumers and Web services providers.
  • XML Schema—A framework that describes XML vocabularies used in business transactions.
  • WSDL: An XML-based language providing a model for describing Web services.
  • WS-Policy: The WS-Policy framework provides a flexible and extensible grammar for describing the capabilities, requirements, and general characteristics of Web services using policies.
  • Universal Description, Discovery, and Integration (UDDI)—A framework to publish and look up Web services on the Internet.

Library

Reference

Task Runner