Home > Articles > Web Services > XML

How do I invoke a method on a server when I’m using SOAP?

There is always some underlying work that must be done to invoke a method on a server. For SOAP as an RPC mechanism, this means constructing a valid HTTP request message. By default, clients should start by using the POST method; only in the case where this fails with an HTTP status of 405 Method Not Allowed should they attempt the request using M-POST. With the existing Web infrastructure, POST seems to be the reasonable choice at this point and time.

Although it is slightly easier to construct and parse the header fields for a POST than for an M-POST, conforming to M-POST can force clients to provide more detail about the client's request. Consider the examples of POST versus M-POST in the following Listing.

Listing  POST Versus M-POST

See code:

SOAP recommends that a SOAPAction header field be provided with each SOAP request, such that the server can gather call information without having to parse the entire SOAP payload. At this point, SOAPAction is optional, and clients only have to use it when mandated by the server. However, it is expected that many of you will want to include SOAPAction in your SOAP implementations, so your server can know the intention of the request message.

Source: This FAQ is excerpted from Understanding SOAP by Kennard Scribner and Mark C. Stiver (2000, Sams, ISBN 0672319225). Refer to this book for more detailed information on SOAP.

  • + Share This
  • 🔖 Save To Your Account

Related Resources

There are currently no related titles. Please check back later.