This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
SOAP Transport
|
111
RPC faults in SOAP 1.1 are simply implemented using the existing guidelines for
SOAP itself. It is expected that the
faultcode attribute would be specific to RPC
application, and that the remaining attributes would be correctly utilized. SOAP 1.2
takes a more thorough look at the fault model for RPC and provides a subsection
within the specification devoted to the subject.
The fault model in SOAP 1.2 uses an additional namespace identifier, which is given
the label
rpc in the specification. The URI for this namespace is http://www.w3.org/
2002/6/soap-rpc, as used for other RPC-specific elements described earlier. The spec-
ification provides four predefined QNames for RPC-specific faults, as shown in
Table 5-9. The table lists the faults in a decreasing order of precedence.
Aside from these predeclared fault codes, the mechanism itself is the same as for gen-
eral SOAP faults. Note that some transport bindings such as HTTP or SMTP may
define additional elements or additional fault codes. If any such definitions apply,
the application has a responsibility to use them as well.
In all RPC fault cases, the
detail and faultstring attributes are defined on a per-
implementation basis.
SOAP Transport
This section is going to briefly cover some of the different methods of transporting
SOAP messages. Later chapters will go into greater depth on some of these (such as
HTTP and SMTP).
Arguably the most significant difference between SOAP and XML-RPC is the fact
that the designers of SOAP refrained from binding it to a specific transport protocol.
While both versions of the protocol refer heavily to the application of HTTP as a
method of transport, this isn’t the only available option. SOAP has been demon-
strated using the Simple Mail Transfer Protocol (SMTP), the Jabber wire protocol,
Microsoft’s .NET framework, and others. Guidelines for protocols such as the Blocks
Table 5-9. RPC fault codes for SOAP 1.2
Fault code Meaning
env:Server
This code is recommended for situations in which the problem is server-related, such as
resource problems or a scheduled black-out period.
env:DataEncodingUnknown
All the elements are qualified to use the encodingStyle attribute provided by SOAP
itself. This code is recommended for cases in which a part of the message uses an
unknown encoding.
rpc:ProcedureNotPresent
If the requested method or procedure is unknown to the server, this fault code must be
used (unless a higher-priority condition was met first).
rpc:BadArguments
If there is a mismatch in the arguments against a specified signature, or when the server
is unable to process the arguments, this code must be used, unless a code of higher-pri-
ority has already been chosen.

Get Programming Web Services with Perl now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.