SOAP - Simple Object Access Protocol



What is SOAP ?

Simple Object Access Protocol is a messaging protocol specification for exchanging structured information. Its purpose is to provide extensibility, neutrality and independence.

  • SOAP uses XML for its message format.
  • SOAP relies on application layer protocols such as HTTP, SMTP, TCP, UDP, or JMS for message negotiation and transmission.

SOAP consists of three parts

  • an envelope, which defines the message structure and how to process it
  • a set of encoding rules for expressing instances of application-defined datatypes
  • a convention for representing procedure calls and responses

SOAP building blocks

A SOAP message is an ordinary XML document containing the following elements:

Element Description Required
Envelope Identifies the XML document as a SOAP message Yes
Header Contains header information No
Body Contains call, and response information Yes
Fault Provides information about errors that occurred while processing the message No

Request Format

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://service.customer.com/types/v1">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-F434D320D890F7CF1715251639631263">
<wsse:Username>admin</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">admin</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<v1:deleteCustomerRequest>
<v1:customerID>123321</v1:customerID>
</v1:deleteCustomerRequest>
</soapenv:Body>
</soapenv:Envelope>

Response Format

1
2
3
4
5
6
7
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://service.customer.com/types/v1">
<soapenv:Body>
<v1:deleteCustomerResponse>
<v1:message>Customer Deleted Successfully</v1:message>
</v1:deleteCustomerResponse>
</soapenv:Body>
</soapenv:Envelope>

Fault Format

1
2
3
4
5
6
7
8
9
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd=="http://www.w3.org/1999/XMLSchema">
<soapenv:Body>
<soapenv:Fault>
<faultcode xsi:type="xsd:string">SOAP_FAULT_DELETECUSTOMER</faultcode>
<faultstring xsi:type="xsd:string">Customer not present</faultstring>
<faultactor>CustNotFound</faultactor>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>

Comments

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×