axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zymbaluk, Greg" <Greg.Zymba...@COMPAQ.com>
Subject Possible bug in RPCElement
Date Fri, 07 Dec 2001 20:57:29 GMT
Greetings,

I think I may have found a bug in the RPCElement class. In a nutshell:

I get a SOAPEnvelope object
I call getBodyElements() to get a Vector of RPCElements in that Envelope
I get an RPCElement out of that Vector
I call getParams on that RPCElement to get a Vector of parameters for
that RPCElement.

After this, the original SOAPEnvelope object has been modified, so that
the contents of the <SOAP-ENV:Body> element gets appended to the end of
the SOAPEnvelope.

I wrote a small program to demonstrate this problem, it is attached as
RPCElementBug.java This program takes an argument which is a filename
containing a XML file with a serialized SOAPEnvelope. I've attached that
file as test.xml

Here is the output of the program:

=======================================================================

C:\>java RPCElementBug test.xml
Envelope BEFORE calling RPCElement.getParams() :
 <SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-insta
nce">
 <SOAP-ENV:Body>
  <ns1:helloWorld xmlns:ns1="TestService">
   <arg0 xsi:type="xsd:string">String!</arg0>
  </ns1:helloWorld>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


Envelope AFTER calling RPCElement.getParams() :
 <SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/enco
ding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="htt
p://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-insta
nce">
 <SOAP-ENV:Body>
  <ns1:helloWorld xmlns:ns1="TestService">
   <arg0 xsi:type="xsd:string">String!</arg0>
  </ns1:helloWorld>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope><ns1:helloWorld xmlns:ns1="TestService">
   <arg0 xsi:type="xsd:string"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-insta
nce">String!</arg0>
  </ns1:helloWorld>

=======================================================================

Notice that after calling getParams() the contents of the
<SOAP-ENV:Body> element has been appended AFTER the </SOAP-ENV:Envelope>
tag. So it appears that calling the getter getParams is actually
mutating the SOAPEnvelope object.

Does this look like a bug or am I doing something wrong.

Thanks,

Greg
 <<RPCElementBug.java>>  <<test.xml>> 


Mime
View raw message