[jbossws-commits] JBossWS SVN: r10174 - stack/native/branches/jbossws-native-2.0.1.SP2_CP05_JBPAPP-2061/src/main/java/org/jboss/ws/metadata/wsdl.
jbossws-commits at lists.jboss.org
jbossws-commits at lists.jboss.org
Wed Jun 10 05:04:27 EDT 2009
Author: mageshbk at jboss.com
Date: 2009-06-10 05:04:26 -0400 (Wed, 10 Jun 2009)
New Revision: 10174
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP05_JBPAPP-2061/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java
Log:
[JBPAPP-2061] Do not register http://www.w3.org/XML/1998/namespace namespace and prevent xml prefix to be bound to any namespace other than its usual namespace
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP05_JBPAPP-2061/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP05_JBPAPP-2061/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java 2009-06-10 08:17:03 UTC (rev 10173)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP05_JBPAPP-2061/src/main/java/org/jboss/ws/metadata/wsdl/WSDLDefinitions.java 2009-06-10 09:04:26 UTC (rev 10174)
@@ -114,11 +114,24 @@
/** Register the given namespaceURI/prefix combination */
public String registerNamespaceURI(String nsURI, String prefix)
{
+ if (Constants.NS_XML.equalsIgnoreCase(nsURI))
+ {
+ //"http://www.w3.org/XML/1998/namespace" is always bound to "xml" prefix
+ //and does not need to be registered.
+ return Constants.PREFIX_XML;
+ }
+ else if (Constants.PREFIX_XML.equalsIgnoreCase(prefix))
+ {
+ throw new IllegalArgumentException("The prefix " + Constants.PREFIX_XML +
+ " cannot be bound to any namespace other than its usual namespace (trying to bind to "
+ + nsURI + " )");
+ }
+
String pre = namespaces.getPrefix(nsURI);
- if (pre == null || pre == "")
+ if (pre == null || 0 == pre.length())
{
pre = namespaces.registerURI(nsURI, prefix);
- log.trace("registerNamespaceURI: " + pre + "=" + nsURI);
+ log.trace("registerNamespaceURI: " + pre + '=' + nsURI);
}
return pre;
}
More information about the jbossws-commits
mailing list