duftler 01/06/19 19:18:17
Modified: targets/soap/faq index.html
Added: targets/soap/faq faq_response_enc_style.html
Log:
Added a document with some information about RPC response encoding styles.
Revision Changes Path
1.4 +4 -0 xml-site/targets/soap/faq/index.html
Index: index.html
===================================================================
RCS file: /home/cvs/xml-site/targets/soap/faq/index.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- index.html 2001/06/20 00:08:31 1.3
+++ index.html 2001/06/20 02:18:14 1.4
@@ -67,6 +67,10 @@
<li class="faqA">
<em><a href="faq-for-WL6.1beta.html">Apache SOAP and WebLogic
6.1Beta</a></em> by Steve Livingston.
</li>
+<li class="faqA">
+Some info on <em><a href="faq_response_enc_style.html">RPC response encoding
styles</a></em>
+by Matthew J. Duftler and Dirck Hecking.
+</li>
</ul>
1.1 xml-site/targets/soap/faq/faq_response_enc_style.html
Index: faq_response_enc_style.html
===================================================================
<html>
<head>
<title>RPC Response Encoding Styles</title>
</head>
<body>
<h1>RPC Response Encoding Styles</h1>
<p>
Since the SOAP specification does not describe how to specify what
encodingStyle to use for the response to an RPC request, Apache SOAP's
RPCJavaProvider employs a simple algorithm to choose an appropriate
encodingStyle.
</p>
<p>
First, the method call element is examined for an encodingStyle
attribute. If there is no encodingStyle attribute on the call element,
each parameter element is then examined in document order for
encodingStyle attributes. The value specified in the first encodingStyle
attribute encountered is used. If none of the parameter elements have an
encodingStyle attribute, SOAP Encoding (section 5 of the SOAP
specification) is used.
</p>
<p>
Put another way, if the call element specifies an encodingStyle, it is
used for the response. If the call element does not specify an
encodingStyle, the first parameter element-specified encodingStyle is
used. If none of the parameter elements specify an encodingStyle, or if
there are no parameter elements, SOAP Encoding is used by default.
</p>
<p>
Let's work through a couple of examples by answering several common
questions:
</p>
<p>
Question: How do I tell an Apache SOAP server (using the RPCJavaProvider;
i.e. provider type="java" in the deployment descriptor) to use literalXML
encodingStyle for the response to my RPC request?
</p>
<p>
Answer: Simply set the desired response encodingStyle as the
encodingStyle of the call object:
</p>
<pre>
// Build the call.
Call call = new Call();
... configure the call (i.e. targetObjectURI, methodName,
typeMappings, etc.) ...
call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);
... make the invocation and cast the value carried in the return
parameter to an org.w3c.dom.Element ...
</pre>
<p>
<b>Note:</b> See samples.addressbook.GetAllListings for a complete
example.
</p>
<p>
Question: How do I tell an Apache SOAP server (using the RPCJavaProvider;
i.e. provider type="java" in the deployment descriptor) to use literalXML
encodingStyle for the response to my RPC request, and still send
parameters using SOAP encoding?
</p>
<p>
Answer: Set the desired response encodingStyle as the encodingStyle of
the call object, and set each parameter's encodingStyle individually:
</p>
<pre>
// Build the call.
Call call = new Call();
... configure the call (i.e. targetObjectURI, methodName,
typeMappings, etc.) ...
call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);
Vector params = new Vector();
// A simple type...
params.addElement(new Parameter("quantity",
int.class,
new Integer(123),
Constants.NS_URI_SOAP_ENC));
// A complex (user-defined) type...
params.addElement(new Parameter("address",
Address.class,
addr,
Constants.NS_URI_SOAP_ENC));
call.setParams(params);
... make the invocation and cast the value carried in the return
parameter to an org.w3c.dom.Element ...
</pre>
<p>
Authors: <a href="mailto:[EMAIL PROTECTED]">Matthew J. Duftler</a> and
Dirck Hecking
</p>
</body>
</html>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]