This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

paritosh pandey
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic