|
|
|||
5.5.4 SOAP Message FormatThe design goal of XRPC is to create a distributed XQuery mechanism with which different XQuery processors at different sites can jointly execute queries. This implies that our XRPC extension also encompasses a network protocol. Network communicating in XRPC uses the Simple Object Access Protocol (SOAP), i.e. XML messages over HTTP. The SOAP XRPC message format is defined in XRPC.xsd. According to the classification in the article "Discover SOAP encoding's impact on Web service performance", the SOAP XRPC protocol belongs to the family of "document/literal". Note that SOAP XRPC should not be confused with SOAP RPC, a sub-protocol defined by the SOAP 1.2 standard 1. XRPC Request Message.
SOAP messages consist of an envelope, with an optional
The actual parameter values of a single function call are enclosed by a
Below we show the SOAP XRPC request message generated for the first example query (Q2) that looks for films played by Sean Connery: <?xml version="1.0" encoding="utf-8"?>
<env:Envelope
xmlns:xrpc="http://monetdb.cwi.nl/XQuery"
xmlns:env="http://www.w3.org/2003/05/soap-envelope"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://monetdb.cwi.nl/XQuery http://monetdb.cwi.nl/XQuery/XRPC.xsd">
<env:Body>
<xrpc:request module="filmdb"
method="filmsByActor"
arity="1"
location="http://example.org/film.xq"
iter-cnt="1"
updCall="false">
<xrpc:call>
<xrpc:sequence>
<xrpc:atomic-value xsi:type="xs:string">Sean Connery</xrpc:atomic-value>
</xrpc:sequence>
</xrpc:call>
</xrpc:request>
</env:Body>
</env:Envelope>
XRPC Response Messages follow the same principles, e.g.: <?xml version="1.0" encoding="utf-8"?>
<env:Envelope
xmlns:xrpc="http://monetdb.cwi.nl/XQuery"
xmlns:env="http://www.w3.org/2003/05/soap-envelope"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://monetdb.cwi.nl/XQuery
http://monetdb.cwi.nl/XQuery/XRPC.xsd">
<env:Body>
<xrpc:response module="filmdb" method="filmsByActor">
<xrpc:sequence>
<xrpc:element><filmName>The Rock</filmName></xrpc:element>
<xrpc:element><filmName>Goldfinger</filmName></xrpc:element>
</xrpc:sequence>
</xrpc:response>
</env:Body>
</env:Envelope>
Inside the body is now a XRPC Error Message. Whenever an XRPC server discovers an error during the processing of an XRPC request, it immediately stops execution and sends back an XRPC error message, using the format of the SOAP Fault message (see SOAP Version 1.2 Part 0: Primer and Part 1: Messaging Framework). For example, the following SOAP Fault message indicates that a required module could not be loaded: <?xml version="1.0" encoding="utf-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
xmlns:xml="http://www.w3.org/XML/1998/namespace">
<env:Body>
<env:Fault>
<env:Code>
<env:Value>env:Receiver</env:Value>
</env:Code>
<env:Reason>
<env:Text xml:lang="en">could not load module!</env:Text>
</env:Reason>
</env:Fault>
</env:Body>
</env:Envelope>
Footnotes[1] SOAP RPC is oriented towards binding with programming languages such as C++ and Java, and specifies parameter marshaling of a certain number of simple (atomic) data type. However, its supported atomic data types do not match directly those of the XQuery Data Model (XDM), and the support for arrays and structs is not relevant in XRPC, where there rather is a need for supporting arbitrary-shaped XML nodes as parameters as well as sequences of heterogeneously typed items. This is the reason why SOAP XRPC message format, while supporting the general SOAP standard over HTTP with the purpose of RPC, implements a new parameter passing sub-format, hence SOAP XRPC != SOAP RPC. |
||||
| © 1994-2011 CWI | Contact us Legal HG web Bugs TestWeb | |||