You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Siva prakash I V <si...@gmail.com> on 2011/03/15 13:02:32 UTC

ADBException: Unexpected subelement Body

Hi,

As I'm new to Java axis binding, please help me in solving this issue.

I've made a http over soap request to a webservice which has properly
responded with a valid soap response. Following are the soap
request/response packets captured from tcpmon

SOAP REQUEST

 <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:Insertxmlns:ns1="
http://www.MyService.net/MyInsert/"><case><accountNumber>1234</accountNumber><primaryContact><firstName>siva</firstName><lastName>prakash</lastName><pin>12345678</pin><countryId>480</countryId></primaryContact><homeNumber><fullNumber></fullNumber></homeNumber><workNumber><fullNumber></fullNumber></workNumber><mobileNumber><fullNumber>1234567890</fullNumber></mobileNumber><clientId>12</clientId><devicePreference>mobile</devicePreference><deliveryPreference>voice</deliveryPreference><createdDate>2011-03-15T16:02:03.878+05:30</createdDate></case></ns1:Insert></soapenv:Body></soapenv:Envelope<http://www.myservice.net/MyInsert/%22%3E%3Ccase%3E%3CaccountNumber%3E1234%3C/accountNumber%3E%3CprimaryContact%3E%3CfirstName%3Esiva%3C/firstName%3E%3ClastName%3Eprakash%3C/lastName%3E%3Cpin%3E12345678%3C/pin%3E%3CcountryId%3E480%3C/countryId%3E%3C/primaryContact%3E%3ChomeNumber%3E%3CfullNumber%3E%3C/fullNumber%3E%3C/homeNumber%3E%3CworkNumber%3E%3CfullNumber%3E%3C/fullNumber%3E%3C/workNumber%3E%3CmobileNumber%3E%3CfullNumber%3E1234567890%3C/fullNumber%3E%3C/mobileNumber%3E%3CclientId%3E12%3C/clientId%3E%3CdevicePreference%3Emobile%3C/devicePreference%3E%3CdeliveryPreference%3Evoice%3C/deliveryPreference%3E%3CcreatedDate%3E2011-03-15T16:02:03.878+05:30%3C/createdDate%3E%3C/case%3E%3C/ns1:Insert%3E%3C/soapenv:Body%3E%3C/soapenv:Envelope>
>


SOAP RESPONSE

<soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><InsertResponsexmlns="
http://www.MyService.net/MyInsert/"><status>0</status><caseId>30</caseId></InsertResponse></soapenv:Body></soapenv:Envelope<http://www.myservice.net/MyInsert/%22%3E%3Cstatus%3E0%3C/status%3E%3CcaseId%3E30%3C/caseId%3E%3C/InsertResponse%3E%3C/soapenv:Body%3E%3C/soapenv:Envelope>
>


But by the time the response is reaching the client stub, stub receives it
as follows

<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Envelope><soapenv:Body><InsertResponsexmlns="
http://www.MyService.net/MyInsert/"><status>0</status><caseId>11</caseId></InsertResponse></soapenv:Body></soapenv:Envelope></soapenv:Body></soapenv:Envelope<http://www.myservice.net/MyInsert/%22%3E%3Cstatus%3E0%3C/status%3E%3CcaseId%3E11%3C/caseId%3E%3C/InsertResponse%3E%3C/soapenv:Body%3E%3C/soapenv:Envelope%3E%3C/soapenv:Body%3E%3C/soapenv:Envelope>
>

where soap Envelope and Body  are encapsulated twice.

As a result of this, client stub is unable to parse and throwing the
following error.

org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException:
Unexpected subelement Body


Can someone help me in identifying the exact issue with this.

Working settings:
Axis 2 1.4, Java 1.5


Thanks,
Siva Prakash