You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Erik Kolodziej <Er...@gmx.de> on 2001/04/26 19:30:06 UTC

Maybe a bug?

Hi,

perhaps I found a bug in org.apache.soap.util.xml.DOMUtils.
Within the method getNamespaceURIFromPrefix there is the following code:

	  Element tempEl = (Element) tempNode;
        String namespaceURI = (prefix == null)
                            ? getAttribute (tempEl, "xmlns")
                            : getAttributeNS (tempEl, NS_URI_XMLNS, prefix);

The method is called, when an attribute-value contains a namespace-prefix.
But with the following SOAP element I get an error ("Unable to resolve
namespace URI for 'SOAPSDK3'").

<Result xmlns:SOAPSDK2="http://www.w3.org/1999/XMLSchema"
	xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/"
	SOAPSDK3:arrayType="SOAPSDK2:string[3]"
	xmlns:SOAPSDK4="http://www.w3.org/1999/XMLSchema-instance"
	SOAPSDK4:type="SOAPSDK3:Array">
  <SOAPSDK3:string>Fritz Kolarzcek</SOAPSDK3:string>
  <SOAPSDK3:string>Johann Meyer</SOAPSDK3:string>
  <SOAPSDK3:string>Irina Moller</SOAPSDK3:string>
</Result>


So I changed the code shown above:

	  String namespaceURI = (prefix == null)
                            ? getAttribute (tempEl, "xmlns")
                            : getAttribute (tempEl, "xmlns:" + prefix);

Now it works. Why was the getAttributeNS method called with NS_URI_XMLNS?
The namespace declarations attributes don´t have a namespaceURI, have they?

Erik


Re: Maybe a bug?

Posted by Scott Nichol <sn...@computer.org>.
Erik,

Sorry, I've missed some postings on this list.  Have you resolved this?  The
error message you have is common when using the SOAP 2.1 release and Xerces
1.3.1 or higher.  You can use Xerces 1.3.0 or 1.2.3 with the SOAP 2.1
release, or use a SOAP nightly build, which I understand resolves the issue
for Xerces 1.3.1 and later.

Scott

----- Original Message -----
From: "Erik Kolodziej" <Er...@gmx.de>
To: "soap-dev" <so...@xml.apache.org>
Sent: Thursday, April 26, 2001 13:30
Subject: Maybe a bug?


> Hi,
>
> perhaps I found a bug in org.apache.soap.util.xml.DOMUtils.
> Within the method getNamespaceURIFromPrefix there is the following code:
>
>   Element tempEl = (Element) tempNode;
>         String namespaceURI = (prefix == null)
>                             ? getAttribute (tempEl, "xmlns")
>                             : getAttributeNS (tempEl, NS_URI_XMLNS,
prefix);
>
> The method is called, when an attribute-value contains a namespace-prefix.
> But with the following SOAP element I get an error ("Unable to resolve
> namespace URI for 'SOAPSDK3'").
>
> <Result xmlns:SOAPSDK2="http://www.w3.org/1999/XMLSchema"
> xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/"
> SOAPSDK3:arrayType="SOAPSDK2:string[3]"
> xmlns:SOAPSDK4="http://www.w3.org/1999/XMLSchema-instance"
> SOAPSDK4:type="SOAPSDK3:Array">
>   <SOAPSDK3:string>Fritz Kolarzcek</SOAPSDK3:string>
>   <SOAPSDK3:string>Johann Meyer</SOAPSDK3:string>
>   <SOAPSDK3:string>Irina Moller</SOAPSDK3:string>
> </Result>
>
>
> So I changed the code shown above:
>
>   String namespaceURI = (prefix == null)
>                             ? getAttribute (tempEl, "xmlns")
>                             : getAttribute (tempEl, "xmlns:" + prefix);
>
> Now it works. Why was the getAttributeNS method called with NS_URI_XMLNS?
> The namespace declarations attributes don´t have a namespaceURI, have
they?
>
> Erik
>
>