snichol 2002/08/29 20:22:54
Modified: java/docs changes.html
java/src/org/apache/soap/server DeploymentDescriptor.java
java/src/org/apache/soap/util/xml DOMUtils.java
java/samples/interop readme.html
Added: java/samples/interop DeploymentDescriptor2.xml
Log:
Bugzilla 12124
Support valid XML namespace constructs in deployment descriptor
mappings for Microsoft interop, e.g. it is now legal to specify
qname="inputInteger"</code> rather than the invalid construct
xmlns:x="" qname="x:inputInteger".
Revision Changes Path
1.42 +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.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- changes.html 29 Aug 2002 03:33:43 -0000 1.41
+++ changes.html 30 Aug 2002 03:22:54 -0000 1.42
@@ -65,6 +65,10 @@
<li>Fix EJB and CORBA providers to check deployment descriptor to
determine whether method is exposed.</li>
<li>Add serialization of collection/map interfaces and concrete classes.</li>
+ <li>Support valid XML namespace constructs in deployment descriptor
+ mappings for Microsoft interop, e.g. it is now legal to specify
+ <code>qname="inputInteger"</code> rather than the invalid construct
+ <code>xmlns:x="" qname="x:inputInteger"</code>.
</ul>
</li>
</ul>
1.35 +1 -1
xml-soap/java/src/org/apache/soap/server/DeploymentDescriptor.java
Index: DeploymentDescriptor.java
===================================================================
RCS file:
/home/cvs/xml-soap/java/src/org/apache/soap/server/DeploymentDescriptor.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- DeploymentDescriptor.java 23 Aug 2002 02:18:23 -0000 1.34
+++ DeploymentDescriptor.java 30 Aug 2002 03:22:54 -0000 1.35
@@ -699,7 +699,7 @@
dd.setMappings (tms);
for (int i = 0; i < nmaps; i++) {
e = (Element) nl.item (i);
- QName qname = DOMUtils.getQualifiedAttributeValue(e, "qname");
+ QName qname = DOMUtils.getQualifiedAttributeValue(e, "qname", true);
tms[i] =
new TypeMapping (DOMUtils.getAttribute (e, "encodingStyle"),
qname,
1.7 +30 -1 xml-soap/java/src/org/apache/soap/util/xml/DOMUtils.java
Index: DOMUtils.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/xml/DOMUtils.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DOMUtils.java 26 Jul 2002 04:48:29 -0000 1.6
+++ DOMUtils.java 30 Aug 2002 03:22:54 -0000 1.7
@@ -60,8 +60,11 @@
import org.w3c.dom.*;
/**
+ * Common operations on DOM structures.
+ *
* @author Matthew J. Duftler
* @author Sanjiva Weerawarana
+ * @author Scott Nichol ([EMAIL PROTECTED])
*/
public class DOMUtils {
/**
@@ -296,10 +299,30 @@
return null;
}
+ /**
+ * Gets an attribute value as a QName. The value must have a prefix
+ * that correctly maps to a namespace URI.
+ */
public static QName getQualifiedAttributeValue(Element el,
String attrName)
throws IllegalArgumentException
{
+ return getQualifiedAttributeValue(el, attrName, false);
+ }
+
+ /**
+ * Gets an attribute value as a QName.
+ *
+ * @param el The DOM Element to which the attribute applies.
+ * @param attrName The name of the attribute.
+ * @param allowNoPrefix If false, an exception is thrown if the attribute
+ * value does not have a prefix.
+ */
+ public static QName getQualifiedAttributeValue(Element el,
+ String attrName,
+ boolean allowNoPrefix)
+ throws IllegalArgumentException
+ {
String attrValue = DOMUtils.getAttribute(el, attrName);
if (attrValue != null)
@@ -310,7 +333,13 @@
: null;
String attrValueLocalPart = attrValue.substring(index + 1);
String attrValueNamespaceURI =
- DOMUtils.getNamespaceURIFromPrefix(el, attrValuePrefix);
+ DOMUtils.getNamespaceURIFromPrefix(el, attrValuePrefix);
+
+ // This matches usage elsewhere in Apache SOAP code: an empty
+ // namespace in a QName specifies no namespace, rather than a
+ // null namespace.
+ if (attrValueNamespaceURI == null && allowNoPrefix)
+ attrValueNamespaceURI = "";
if (attrValueNamespaceURI != null)
{
1.2 +9 -0 xml-soap/java/samples/interop/readme.html
Index: readme.html
===================================================================
RCS file: /home/cvs/xml-soap/java/samples/interop/readme.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- readme.html 19 May 2001 17:38:53 -0000 1.1
+++ readme.html 30 Aug 2002 03:22:54 -0000 1.2
@@ -1,12 +1,21 @@
<html>
<body>
+<p>
The client and server for this sample implement the SOAP interoperability echo
test suite as defined by the <a
href="http://groups.yahoo.com/group/soapbuilders">soapbuilders</a> community.
More info on these tests, and a selection of clients and servers to test
against, is available at <a href="http://www.xmethods.net/ilab">the XMethods
interop lab</a>.
+</p>
+<p>
+Note that there are two deployment descriptor options. DeploymentDescriptor.xml
+is the "classic" structure. DeploymentDescriptor2.xml works only with
+Apache SOAP versions later than 2.3.1. All namespace definitions are valid
+according to the XML Namespace spec, so parsers like Xerces 2.0.2 accept it.
+</p>
<p>
Author: <a href="mailto:[EMAIL PROTECTED]">Glen Daniels</a>
+</p>
</body>
</html>
1.1 xml-soap/java/samples/interop/DeploymentDescriptor2.xml
Index: DeploymentDescriptor2.xml
===================================================================
<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
id="http://soapinterop.org/"
checkMustUnderstands="true">
<isd:provider type="java"
scope="Application"
methods="nop echoInteger echoString echoFloat echoStruct
echoIntegerArray echoFloatArray echoStringArray echoStructArray echoVoid echoBase64
echoHexBinary echoDate echoDecimal echoBoolean echoMap echoMapArray">
<isd:java class="samples.interop.EchoTestService" static="false"/>
<isd:option key="SessionRequired" value="false"/>
</isd:provider>
<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener>
<isd:mappings>
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="inputInteger"
xml2JavaClassName="org.apache.soap.encoding.soapenc.IntDeserializer"/>
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="inputFloat"
xml2JavaClassName="org.apache.soap.encoding.soapenc.FloatDeserializer"/>
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="inputString"
xml2JavaClassName="org.apache.soap.encoding.soapenc.StringDeserializer"/>
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="inputStruct"
xml2JavaClassName="samples.interop.DataSerializer"/>
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="inputIntegerArray"
xml2JavaClassName="org.apache.soap.encoding.soapenc.ArraySerializer"/>
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="inputFloatArray"
xml2JavaClassName="org.apache.soap.encoding.soapenc.ArraySerializer"/>
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="inputStringArray"
xml2JavaClassName="org.apache.soap.encoding.soapenc.ArraySerializer"/>
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="inputStructArray"
xml2JavaClassName="org.apache.soap.encoding.soapenc.ArraySerializer"/>
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:x="http://soapinterop.org/xsd" qname="x:SOAPStruct"
javaType="samples.interop.Data"
java2XMLClassName="samples.interop.DataSerializer"
xml2JavaClassName="samples.interop.DataSerializer"/>
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:x="http://soapinterop.org/xsd" qname="x:ArrayOfSOAPStruct"
xml2JavaClassName="org.apache.soap.encoding.soapenc.ArraySerializer"/>
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="inputBase64"
xml2JavaClassName="org.apache.soap.encoding.soapenc.Base64Serializer"/>
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="inputHexBinary"
xml2JavaClassName="org.apache.soap.encoding.soapenc.HexDeserializer"/>
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="inputDate"
xml2JavaClassName="org.apache.soap.encoding.soapenc.DateSerializer"/>
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="inputDecimal"
xml2JavaClassName="org.apache.soap.encoding.soapenc.DecimalDeserializer"/>
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="inputBoolean"
xml2JavaClassName="org.apache.soap.encoding.soapenc.BooleanDeserializer"/>
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="inputMap"
xml2JavaClassName="org.apache.soap.encoding.soapenc.HashtableSerializer"/>
</isd:mappings>
</isd:service>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>