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 Ex...@nokia.com on 2001/02/15 14:24:01 UTC
apache 2.0 Response parameters
Hi,
I'm attempting to write a java client using apache SOAP 2.0.
The problem I'm having is when trying to decode the Response to my request.
The SOAP Body of the response seen on the wire is as follows :
<SOAP-ENV:Body>
<m:GetDataObjectResponse
xmlns:m="urn:application-interface-service">
<AttributeList
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xsi:type="xsd:string">
<LastName xsi:type="xsd:string">Shaun</LastName>
<MiddleName xsi:type="xsd:string"/>
<FirstName xsi:type="xsd:string">Ohagan</FirstName>
<Title xsi:type="xsd:string">Mr</Title>
</AttributeList>
</m:GetDataObjectResponse>
</SOAP-ENV:Body>
NB that the body contains nested elements. How do I access the LastName etc
elements ?
If I do
...
Vector rparams = rsp.getParams();
System.out.println( "no of params : " + rparams.size());
Parameter attributeList = (Parameter)rparams.get( 0 );
attributeList.toString()
This give me -
[name=AttributeList] [type=class java.lang.String] [value=]
[encodingStyleURI=null]
In summary it looks like the Response object only provides the first level
of nesting of the response. Shouldn't the parameter attributeList value
here be another parameter vector ?
Also one more thing. I've upgraded to Apache 2.1 and found that my
application fails. The TCP trace shows that there is now a
<?xml version='1.0' encoding='UTF-8'?>
at the top of the SOAP xml. I believe this is illegal according to the soap
spec 1.0 and wasn't present in V2.0. How do I get rid of it ?
Regards,
Shaun O'Hagan
Nokia UK.