• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
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
Request
"<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:doBillerRegistration xmlns:ns1="http://121.241.242.73:8101/wsBillerReg/services/WebServiceBillerRegistration"><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>"

Response
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope 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-instance">
<SOAP-ENV:Body>
<ns1:doBillerRegistrationResponse SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://121.241.242.73:8101/wsBillerReg/services/WebServiceBillerRegistration">
<doBillerRegistrationResult xsi:type="xsd:string">pin<<>>pinelabs<<>>000000000528<<>>5632547895623|9920958120<<>>KK|chirag test<<>>1000046394<<>>N<<>>F<<>>200024<<>>BILLER ALREADY PRESENT.<<>></doBillerRegistrationResult>
</ns1:doBillerRegistrationResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


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


try {


} catch (Exception e) {
logger.trace(e,e);
e.printStackTrace();
throw new Exception("Marshalling failed");
}

func.setIn0("pin");
func.setIn1("pinelabs");
func.setIn2("000000000528");
func.setIn3("5632547895623|9920958120");
func.setIn4("KK|chirag test");
func.setIn5("N");

//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();

wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://121.241.242.73:8101/wsBillerReg/services/WebServiceBillerRegistration" xmlns:impl="http://121.241.242.73:8101/wsBillerReg/services/WebServiceBillerRegistration-impl" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:intf="http://121.241.242.73:8101/wsBillerReg/services/WebServiceBillerRegistration" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<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>
<wsdl:message name="doBillerRegistrationResponse">
<wsdl:part name="return" type="xsd:string"/>
</wsdl:message>
<wsdl:portType name="BillerRegistration">
<wsdl:operation name="doBillerRegistration" parameterOrder="in0 in1 in2 in3 in4 in5">
<wsdl:input message="intf:doBillerRegistrationRequest"/>
<wsdl:output message="intf:doBillerRegistrationResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="WebServiceBillerRegistrationSoapBinding" type="intf:BillerRegistration">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="doBillerRegistration">
<wsdlsoap:operation soapAction=""/>
<wsdl:input>
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://121.241.242.73:8101/wsBillerReg/services/WebServiceBillerRegistration"/>
</wsdl:input>
<wsdl:output>
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://121.241.242.73:8101/wsBillerReg/services/WebServiceBillerRegistration"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="BillerRegistrationService">
<wsdl:port name="WebServiceBillerRegistration" binding="intf:WebServiceBillerRegistrationSoapBinding">
<wsdlsoap:address location="http://121.241.242.73:8101/wsBillerReg/services/WebServiceBillerRegistration"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

kindly help to solve this issue.
 
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at XMLReader.main(XMLReader.java:17)

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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic