Home > Articles > Programming > .NET and Windows Programming

Introduction to SOAP 1.1

  • PrintPrint
  • Share ThisShare This
  • DiscussDiscuss

10.5 Introduction to the SOAP HTTP binding

SOAP defines a binding to the HTTP protocol. This binding describes the relationship between parts of the SOAP request message and various HTTP headers. All SOAP requests use the HTTP POST method and specify at least three HTTP headers: Content-Type, Content-Length, and a custom header SOAPAction. The actual SOAP message is passed as the body of the request or response.



10.5.1 Content-Type



Content-Type: text/xml; charset=character encoding

The Content-Type header for SOAP requests and responses specifies the MIME type for the message and is always text/xml. It may also specify the character encoding used for the XML body of the HTTP request or response. This follows the text/xml part of the header values.

Example Use of Content-Type

POST /endpoint.pl HTTP/1.1
Content-Type: text/xml

An example Content-Type header in an HTTP request

10.5.2 Content-Length

The Content-Length header for SOAP requests and responses is set to the number of bytes in the body of the request or response.

Examples Use of Content-Length

POST /endpoint.pl HTTP/1.1
Content-Type: text/xml
Content-Length: 167
SOAPAction: urn:example-org:demos#Method

<s:Envelope 
  xmlns:s='http://schemas.xmlsoap.org/soap/envelope/' >
 <s:Body>
  <m:Method xmlns:m='urn:example-org:demos' />
 </s:Body>
</s:Envelope>

An example Content-Length header in an HTTP request. The request is encoding using an 8-bit encoding format.

Use of Content-Length with charset

POST /endpoint.pl HTTP/1.1
Content-Type: text/xml; charset=UTF-16
Content-Length: 167
SOAPAction: urn:example-org:demos#Method

<s:Envelope 
  xmlns:s='http://schemas.xmlsoap.org/soap/envelope/' >
 <s:Body>
  <m:Method xmlns:m='urn:example-org:demos' />
 </s:Body>
</s:Envelope>

An example Content-Length header in an HTTP request. The request is encoding using a 16-bit encoding format.

10.5.3 SOAPAction

The SOAPAction header indicates to the HTTP server that the request is a SOAP request. The value of the header is a URI. Beyond that, its value is undefined.

Example Use of SOAPAction

POST /endpoint.pl HTTP/1.1
Content-Type: text/xml; charset=UTF-16
Content-Length: 167
SOAPAction: urn:example-org:demos#Method

<s:Envelope 
  xmlns:s='http://schemas.xmlsoap.org/soap/envelope/' >
 <s:Body>
  <m:Method xmlns:m='urn:example-org:demos' />
 </s:Body>
</s:Envelope>

An example SOAPAction header in an HTTP request. The string preceding the # is the namespace name of the first child of the Body element whereas the string following the # is the local name of that element.

  • Share ThisShare This
  • Your Account

Discussions

Make a New Comment

You must log in in order to post a comment.

Related Resources

User Group Organizations: Finding Support in the Greater IT Community
By Emily Nave on July 29, 2010 1 Comment

Birds of a feather flock together, right? If you’re already a member of an established user group or looking for other like-minded technology evangelists, connecting with peers is an important part of being an active voice in the IT community.

 Big Nerd RanchAsk Big Nerd Ranch: Blocks in Objective-C
By Big Nerd Ranch on June 24, 2010 No Comments

Adam Preble answers a question about blocks.

Danny KalevYves Smith: Suspicions that The Fed is manipulating Wall Street
By Danny Kalev on May 24, 2010 No Comments

Yves Smith, the nom de plume of the creator of Naked Capitalism and one of the most savvy and respected members of the blogosphere. In professional life Yves is known as Susan Webber. Yves recently gave an interview to an Israeli financial newspaper in which she claims that a federal team unofficially called "the plunge protection team" is manipulating the stocks on Wall Street.

See All Related Blogs

Informit Network