0

I am calling .net webservice in JAVA class which will read string from text file and UTF8 encode that and return that string to JAVA .Some times the correct output is coming . but sometimes this is giving illegal argument exception eventhough the text in text file is in correct format . Below is the exception I am getting:

**SEVERE: Servlet.service() for servlet BaseController threw exception
java.lang.IllegalArgumentException: The char '0x0' after 'return code:  502
<HEAD><TITLE>Parent proxy is not responding</TITLE></HEAD>
<BODY BGCOLOR="white" FGCOLOR="black"><H1>Parent proxy is not responding</H1><HR>
<FONT FACE="Helvetica,Arial"><B>
Description: Parent proxy is not responding</B></FONT>
<HR>
<!-- default "Parent proxy is not responding" response (502) -->
</BODY>
' is not a valid XML character.
    at org.apache.axis.components.encoding.AbstractXMLEncoder.encode(AbstractXMLEncoder.java:110)
    at org.apache.axis.utils.XMLUtils.xmlEncodeString(XMLUtils.java:131)
    at org.apache.axis.utils.DOM2Writer.normalize(DOM2Writer.java:344)
    at org.apache.axis.utils.DOM2Writer.print(DOM2Writer.java:246)
    at org.apache.axis.utils.DOM2Writer.print(DOM2Writer.java:208)
    at org.apache.axis.utils.DOM2Writer.serializeAsXML(DOM2Writer.java:77)
    at org.apache.axis.utils.DOM2Writer.serializeAsXML(DOM2Writer.java:60)
    at org.apache.axis.utils.DOM2Writer.nodeToString(DOM2Writer.java:49)
    at org.apache.axis.utils.XMLUtils.privateElementToString(XMLUtils.java:433)
    at org.apache.axis.utils.XMLUtils.ElementToString(XMLUtils.java:442)
    at org.apache.axis.utils.XMLUtils.getInnerXMLString(XMLUtils.java:542)
    at org.apache.axis.AxisFault.dumpToString(AxisFault.java:388)
    at org.apache.axis.AxisFault.printStackTrace(AxisFault.java:789)
    at java.lang.Throwable.printStackTrace(Throwable.java:451)
    at com.hcl.webservice.BaseController.doPost(BaseController.java:155)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:680)
**

Please help in solving this problem. Thanks in advance

1 Answer 1

0

The message says that the NULL-character (0x0) after the complete following string:

return code:  502
<HEAD><TITLE>Parent proxy is not responding</TITLE></HEAD>
<BODY BGCOLOR="white" FGCOLOR="black"><H1>Parent proxy is not responding</H1><HR>
<FONT FACE="Helvetica,Arial"><B>
Description: Parent proxy is not responding</B></FONT>
<HR>
<!-- default "Parent proxy is not responding" response (502) -->
</BODY>

is not a valid XML character. In other words, you are experiencing network problems involving the parent proxy, and the body of the HTTP response contains a human-readable description of the problem in HTML format. Your service client is trying to parse this text as XML and therefore your error.

Sign up to request clarification or add additional context in comments.

1 Comment

Hi Marko, Thanks for your reply .I have removed the hexa decimal value of ' from the encoded string and its working fine without exception.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.