Tutorials Hut

  • What is SOAP Web service & its Structure

    This article will present you with a complete idea about SOAP Web service and how the SOAP message look like .

    1-What is SOAP Web service & its Structure

    What is SOAP WebService?

    • SOAP stands for Simple Object Access Protocol.
    • It is is a W3C standard
    • SOAP is an XML-based messaging protocol for exchanging information among computers.
    • It is a XML-based protocol for accessing web services.
    • It defines a set of rules for structuring messages that can be used for simple one-way messaging but is particularly useful for performing RPC-style (Remote Procedure Call) request-response dialogues
    • SOAP is designed to communicate via Internet
    • SOAP is based on XML
    • SOAP is platform and language independent
    • SOAP enables client applications to easily connect to remote services and invoke remote methods.
    3- SOAP message Structure- SOAP

    SOAP message Structure

    SOAP message consists of three parts:

      • SOAP Envelope
      • SOAP Header (optional)
      • SOAP Body

    SOAP message Skelton:

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Transactions, priorites, etc. -->
    <!-- Some content -->

    SOAP Envelope:

      • The SOAP Envelope construct defines an overall framework for expressing what is in a message and who should deal with it.
      • The Envelope is the top element of the XML document representing the message.
      • The Envelope element is always the root element of a SOAP message.
      • The Envelope element contains an optional Header element followed by a mandatory Body element.


           <m:GetLastTradePriceResponse xmlns:m="Some-URI">

    SOAP Header:

      • Header is optional
      • SOAP header element can contain information such as authentication credentials which can be used by the calling application.
      • It can also contain the definition of complex types which could be used in the SOAP message.
      • By default, the SOAP message can contain parameters which could be of simple types such as strings and numbers, but can also be a complex object type.


    	<!-- security credentials --> 
    	<s:credentials xmlns:s="urn:examples-org:security"> 	<username>abc</username> 

    SOAP Body:

    • The Body element represents the message payload
    • The SOAP body is a mandatory element that contains the application-defined XML data being exchanged in the SOAP message.
    • Immediate child elements of the SOAP Body element may be namespace-qualified.


    	<x:TransferFunds xmlns:x="urn:examples-org:banking"> 
    3- SOAP message Structure- SOAP

  • Leave a Reply

    Your email address will not be published. Required fields are marked *