Copyright © 2002 W3C® (MIT, INRIA, Keio), All Rights Reserved. W3C liability, trademark, document use, and software licensing rules apply.
TBD.
This document is for discussion purposes only and has no official status.
1 Introduction
1.1 Requirements
1.2 Out-of-scope
2 Overview
3 Processing Model
3.1 SOAP HTTP POST to HTTP URI:
3.2 HTTP URI to SOAP HTTP POST
4 Appendix
4.1 Issues List
4.2 Discussion of out-of-scope requirements
4.2.1 Structured content
4.2.2 SOAP Headers
4.2.3 Mixed namespaces
4.2.4 Attributes
4.3 Alternative Approaches
4.3.1 Noahs proposal
4.3.2 Specialized parameter for SOAP method
name
For a variety of reasons, it is desirable that some web services, compliant with the SOAP HTTP Binding, can also be accessed via HTTP GET. This requirement mandates that the information necessary to access the resource can be expressed in an HTTUP URI The purpose of this document is to set forth a minimal set of requirements, to introduce a model and corresponding syntax for creating URIs responsive to HTTP GET. The main audience is Web Service authors who have need of expressing Web Services in HTTP GET URIspace.
Simple RPC style SOAP requests can be encoded in a URL format. The subset of SOAP Messages are:
BODY only
Document or RPC Encoded requests where the BODY contains only one Child, aka a method
requests where the method contains only children. That is, structured parameters are excluded
The mapping from SOAP HTTP POST Binding to HTTP GET and back shall be automatable.
An HTTP Node shall not need to differentiate between SOAP-ness and non-soapness.
Using the oft-quote stock quote example, it is a simple matter to convert the XML structure into a URL-encoded structure. From the SOAP 1.2 usage scenarios document,
<env:Envelope xmlns:env=http://www.w3.org/2001/12/soap-envelope> <env:Body> <r:GetLastTradePrice env:encodingStyle=http://www.w3.org/2001/12/soap-encoding xmlns:r=http://example.org/2001/06/quotes> <r:Symbol>DEF</r:Symbol> </r:GetLastTradePrice> </env:Body> </env:Envelope> |
This message is sent via the SOAP HTTP POST binding to a URI, such as http://www.example.org/stockService
A sample mapping of how this would like in URI space is (remember the "/" isn't escaped for illustrative purposes):
GET example.org/stockService/LastTradingPrice&xmlnsuri=http://example.org/2001/06/quotes&xmlns=r&encodingStyle=http://www.w3.org/2001/12/soap-encoding&Symbole=DEF |
The rules for the mapping are:
The SOAP Bodys first child element name prefix and postPrefix are extracted. Prefixes that are allowed are only get
Assuming the prefix is get, case-insensitive, the postPrefix preceeded by a "/" are appended to the URL
The namespace name is escaped and converted into the value of the xmlnsuri parameter
The namespace prefex is converted into the value of the xmlns parameter.
An encoding style attribute is converted into an encodingStyle parameter
each of the children of the SOAP Body child element are escaped and converted into element=value parameters
For a node to map the GET request into a SOAP HTTP POST request, it follows the reverse order:
An HTTP Node that is configured to map HTTP GETs into URIs SHOULD convert requests into SOAP HTTP POSTs:
Create a SOAP envelope with an empty body element. The namespace prefix is "env"
Create the body element name by concatenating "Get" with the last item in the URI path element
Give the body element the correct prefix from the xmlns parameter
Create an xmlns: attribute from the xmlns parameter and the unescaped xmlnsuri parameter
Create an encodingStyle attribute if one exists in the parameter list
Create elements for each of the subsequent parameters. The element Name is the parameter name, and the element content is the parameter value after unescaping is peformed.
This is section is to show possible solutions to the out-of-scope requirements. It is only here to prove that there are possible solutions.
It possible to convert a subset of XML syntax into URI space. One mechanism to do this is to embed the relative XPath expression in the URI parameter name. this requires escaping the "/". For illustrative purposes, the "/" has not been escaped. For example
<parent><child/></parent> |
could be encoded as
&parent=&./child= |
Another example has multiple children
<parent><child>a</child><child>b</child></parent><parent><child>c</child></parent> |
could be encoded as
&parent=&./child=a&child=b&../parent=&./child=c |
The oft-quoted stock quote example regularly has a simple HTTP Header associated with it
<env:Envelope xmlns:env=http://www.w3.org/2001/12/soap-envelope> <env:Header xmlns:env=http://www.w3.org/2001/12/soap-envelope > <t:Transaction xmlns:t=http://example.org/2001/06/tx > 5 </t:Transaction> </env:Header> <env:Body> <r:GetLastTradePrice env:encodingStyle=http://www.w3.org/2001/12/soap-encoding xmlns:r=http://example.org/2001/06/quotes> <r:Symbol>DEF</r:Symbol> </r:GetLastTradePrice> </env:Body> </env:Envelope> |
A sample mapping of how this would like in URI space is:
GET example.org/stockService/LastTradingPrice&Header=&xmlnsuri=http://example.org/2001/06/tx&xmlns=t&Transaction=5&../../Body=&xmlnsuri=http://example.org/2001/06/quotes&xmlns=r&encodingStyle=http://www.w3.org/2001/12/soap-encoding&Symbole=DEF |
This still doesnt allow multiple namespaced elements or attributes, such as env:mustUnderstand="1".
One approach is to map the "getLastTradePrice" element name into a special URL paramater, perhaps dropping the "get". As in,
GET example.org/stockService/&method=LastTradePrice&... |