snichol 2002/06/26 04:39:52
Modified: java/docs changes.html
java/src/org/apache/soap/encoding/soapenc SoapEncUtils.java
Log:
In the absence of an xsi:type attribute, check the element
namespace URI for SOAP-ENC to imply a type. For now, just
support SOAP-ENC:Array. This allows interop with .NET arrays
without a type mapping.
Revision Changes Path
1.29 +4 -0 xml-soap/java/docs/changes.html
Index: changes.html
===================================================================
RCS file: /home/cvs/xml-soap/java/docs/changes.html,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- changes.html 25 Jun 2002 21:23:53 -0000 1.28
+++ changes.html 26 Jun 2002 11:39:52 -0000 1.29
@@ -35,6 +35,10 @@
<li>Added the ability to get copies of HTTP request and
response programmatically. This is useful when debugging
SSL, as wire dumps are of no use then.</li>
+ <li>In the absence of an xsi:type attribute, check the element
+ namespace URI for SOAP-ENC to imply a type. For now, just
+ support SOAP-ENC:Array. This allows interop with .NET arrays
+ without a type mapping.</li>
</ul>
</li>
</ul>
1.12 +17 -1
xml-soap/java/src/org/apache/soap/encoding/soapenc/SoapEncUtils.java
Index: SoapEncUtils.java
===================================================================
RCS file:
/home/cvs/xml-soap/java/src/org/apache/soap/encoding/soapenc/SoapEncUtils.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- SoapEncUtils.java 10 Jun 2002 05:59:00 -0000 1.11
+++ SoapEncUtils.java 26 Jun 2002 11:39:52 -0000 1.12
@@ -68,6 +68,7 @@
* the <code>SOAP-ENC</code> encoding style.
*
* @author Matthew J. Duftler ([EMAIL PROTECTED])
+ * @author Scott Nichol ([EMAIL PROTECTED])
*/
public class SoapEncUtils
{
@@ -316,7 +317,10 @@
/**
* Get the value of the xsi:type attribute, for varying values of
- * the xsi namespace.
+ * the xsi namespace. In the absence of an xsi:type attribute,
+ * determine whether the element QName implies a type, e.g. if it
+ * has the SOAP-ENC namespaceURI. For now, this is limited to
+ * checking for SOAP-ENC:Array.
*/
public static QName getTypeQName(Element el)
throws IllegalArgumentException
@@ -338,6 +342,18 @@
// Try 1999
typeQName = getAttributeValue(el, Constants.NS_URI_1999_SCHEMA_XSI,
Constants.ATTR_TYPE, null, false);
+
+ if (typeQName != null)
+ return typeQName;
+
+ // Check for SOAP-ENC namespace for element name
+ String nsURI = el.getNamespaceURI();
+ if (nsURI != null && nsURI.equals(Constants.NS_URI_SOAP_ENC)) {
+ // For now, just check for Array
+ String localName = el.getLocalName();
+ if (localName.equals("Array"))
+ typeQName = new QName(nsURI, localName);
+ }
return typeQName;
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>