[ http://jira.codehaus.org/browse/XFIRE-631?page=all ]
Dan Diephouse updated XFIRE-631:
--------------------------------
Fix Version/s: (was: 1.2.3)
1.2.4
> Exception caused by NamespaceHelper class when no targetNamespace is defined.
> -----------------------------------------------------------------------------
>
> Key: XFIRE-631
> URL: http://jira.codehaus.org/browse/XFIRE-631
> Project: XFire
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.2.1
> Environment: XFire version: 1.2.1
> XmlBeans version: 2.2.0
> JDom version: 1.0.1
> Reporter: Chris Mathrusse
> Assigned To: Dan Diephouse
> Fix For: 1.2.4
>
> Attachments: 3A4_MS_V02_02_PurchaseOrder.xsd
>
>
> I am getting an exception from JDom that appears to be caused by the
> NamespaceHelper class in the getUniquePrefix method.
> 1 public static String getUniquePrefix(Element element, String namespaceURI)
> 2 {
> 3 String prefix = getPrefix(element, namespaceURI);
> 4
> 5 if (prefix == null)
> 6 {
> 7 prefix = getUniquePrefix(element);
> 8 element.addNamespaceDeclaration(Namespace.getNamespace(prefix,
> namespaceURI));
> 9 }
> 10 return prefix;
> 11 }
> In this method the element that is passed in appears to contain all the
> Namespaces defined for the service. Looking at the data contained within this
> object, the Namespace field shows:
> [Namespace: prefix "wsdl" is mapped to URI "http://schemas.xmlsoap.org/wsdl/"]
> The additional Namespaces field contains the following:
> [[Namespace: prefix "xsd" is mapped to URI
> "http://www.w3.org/2001/XMLSchema"],
> [Namespace: prefix "soap11" is mapped to URI
> "http://schemas.xmlsoap.org/soap/envelope/"],
> [Namespace: prefix "soapenc11" is mapped to URI
> "http://schemas.xmlsoap.org/soap/encoding/"],
> [Namespace: prefix "soap12" is mapped to URI
> "http://www.w3.org/2003/05/soap-envelope"],
> [Namespace: prefix "soapenc12" is mapped to URI
> "http://www.w3.org/2003/05/soap-encoding"],
> [Namespace: prefix "wsdlsoap" is mapped to URI
> "http://schemas.xmlsoap.org/wsdl/soap/"],
> [Namespace: prefix "tns" is mapped to URI
> "http://services.web.cosmos.it.sybase.com"], null]
> The passed in namespaceURI contains a zero length String. The attempt to get
> the namespace from the element at line 3 shown above returns a null, so the
> flow falls into the if block and a call to getUniquePrefix at line 7 is made.
> This method returns a value of ns1 for the empty namespaceURI. When line 8 is
> executed, attempting to add the namespace to the element, JDom complains with
> the following message:
> The name "" is not legal for JDOM/XML namespaces: Namespace URIs must be non-
> null and non-empty Strings.
> This makes sense because there cannot be a namespace with an emtpy URI. I
> don't believe that the namespace 'ns1' should be created for an empty
> namespaceURI but rather support the NO_NAMESPACE value defined in the JDOM
> class org.jdom.Namespace. In JDom 1.0.1 the Namepace class was modified to
> accomodate the NO_NAMESPACE scenario correctly in the method
> getNamespace(String prefix, String uri). A simple solution to this problem
> would be to remove line 7 all together and allow the Namespace class to
> handle the values appropriately.
> I;ve attached my schema to this message.
> History:
> Our requirement is to receive orders from our distributors that are currently
> supporting RosettaNet standards. These distributors have currently
> implemented a version of the RosettaNet standard that is based upon a DTD.
> Because they have an existing implementation we need to implement a web
> service that will support the documents that they will be sending to us.
> There is absoutely no chance that the envelope or the data contained within
> will contain any namespace pertaining to the payload, so I have been forced
> to creating a schema, based upon the DTD, that defines the document structure
> without a namespace. I am using XmlBeans for our document representation.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email