This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Services and the fly likes org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement " Watch "org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement " New topic

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

paritosh pandey

Joined: Jan 08, 2008
Posts: 10
While parsing the webservice response I am getting org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement

I am using axis 1.5.1 version My WSDL, request and response Strings are as following
"<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv=""><soapenv:Body><ns1:doBillerRegistration xmlns:ns1=""><in0>pin</in0><in1>pinelabs</in1><in2>000000000528</in2><in3>5632547895623|9920958120</in3><in4>KK|chirag test</in4><in5>N</in5></ns1:doBillerRegistration></soapenv:Body></soapenv:Envelope>"

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:xsd="" xmlns:xsi="">
<ns1:doBillerRegistrationResponse SOAP-ENV:encodingStyle="" xmlns:ns1="">
<doBillerRegistrationResult xsi:type="xsd:string">pin<<>>pinelabs<<>>000000000528<<>>5632547895623|9920958120<<>>KK|chirag test<<>>1000046394<<>>N<<>>F<<>>200024<<>>BILLER ALREADY PRESENT.<<>></doBillerRegistrationResult>

BillerRegistrationServiceStub.DoBillerRegistration func = new BillerRegistrationServiceStub.DoBillerRegistration();

try {

} catch (Exception e) {
throw new Exception("Marshalling failed");

func.setIn4("KK|chirag test");

//wsdl version
//axis version
//encoded response
//look at sample response of SOAP envelope from one of our service
BillerRegistrationServiceStub.DoBillerRegistrationResponse result = stub.doBillerRegistration(func); //getting error in this line
String responseStr = result.get_return();

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="" xmlns:impl="" xmlns:SOAP-ENC="" xmlns:intf="" xmlns:wsdlsoap="" xmlns:xsd="" xmlns:wsdl="" xmlns="">
<wsdl:message name="doBillerRegistrationRequest">
<wsdl:part name="in0" type="xsd:string"/>
<wsdl:part name="in1" type="xsd:string"/>
<wsdl:part name="in2" type="xsd:string"/>
<wsdl:part name="in3" type="xsd:string"/>
<wsdl:part name="in4" type="xsd:string"/>
<wsdl:part name="in5" type="xsd:string"/>
<wsdl:message name="doBillerRegistrationResponse">
<wsdl:part name="return" type="xsd:string"/>
<wsdl:portType name="BillerRegistration">
<wsdlperation name="doBillerRegistration" parameterOrder="in0 in1 in2 in3 in4 in5">
<wsdl:input message="intf:doBillerRegistrationRequest"/>
<wsdlutput message="intf:doBillerRegistrationResponse"/>
<wsdl:binding name="WebServiceBillerRegistrationSoapBinding" type="intf:BillerRegistration">
<wsdlsoap:binding style="rpc" transport=""/>
<wsdlperation name="doBillerRegistration">
<wsdlsoapperation soapAction=""/>
<wsdlsoap:body use="encoded" encodingStyle="" namespace=""/>
<wsdlsoap:body use="encoded" encodingStyle="" namespace=""/>
<wsdl:service name="BillerRegistrationService">
<wsdl:port name="WebServiceBillerRegistration" binding="intf:WebServiceBillerRegistrationSoapBinding">
<wsdlsoap:address location=""/>

kindly help to solve this issue.
R Srini
Ranch Hand

Joined: Feb 19, 2010
Posts: 215
Hi. I put your response XML in NewFile.xml. And I got this program (adapted from this) to read it:

When the text is this (from your original response xml):

pin<<>>pinelabs<<>>000000000528<<>>5632547895623|9920958120<<>>KK|chiragtest<<>>1000046394<<>>N<<>>F<<>>200024<<>>BILLER ALREADYPRESENT.<<>>

I get this error:
[Fatal Error] NewFile.xml:8:58: The content of elements must consist of well-formed character data or markup.
org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.
at Source)
at Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at XMLReader.main(

But when I change the text to a regular string like "message", then it read the xml ok. So based on this, maybe the problem is with all the <<>> characters, because if I remove all of them, then the program works fine. Now, if the strange text were to be wrapped inside a CDATA tag like this, then it works fine:

<![CDATA[pin><<>>pinelabs<<>>000000000528<<>>5632547895623|9920958120<<>>KK|chiragtest<<>>1000046394<<>>N<<>>F<<>>200024<<>>BILLER ALREADYPRESENT.<<>>]]>

Hope that helps, though I am not so sure . If you have a resolution, kindly share it.
Consider Paul's rocket mass heater.
subject: org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement
Similar Threads
Consuming a web service using Java
conditional axis web service - sample nowhere
How to provide interoperabilty?? RPC or document???
wstools unable to parse WSDL from Axis1.4
de/serializers for ArrayLists