Author |
Message
|
visasimbu |
Posted: Mon Aug 24, 2015 10:37 am Post subject: An invalid XML character (Unicode: 0x1f) was found |
|
|
 Disciple
Joined: 06 Nov 2009 Posts: 171
|
Hi All,
I have message flow look like
SOAP Input node - >compute node -> XSLT transform node -> HTTP Request node -> SOAP Reply node
WMB version v7.0.0.7
The response message is not parssed and getting below exception in the http request node. Is there any clue on this exception
Code: |
<Exception>
<Label/>
<Error>3701</Error>
<Text>Error Making SOAP JNI Call: method_com_ibm_broker_axis2_Axis2Invoker_prepareToSendReplyNonSOAP</Text>
<Inserts>method_com_ibm_broker_axis2_Axis2Invoker_prepareToSendReplyNonSOAP / org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: An invalid XML character (Unicode: 0x1f) was found in the prolog of the document. / Frame : 0 org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: An invalid XML character (Unicode: 0x1f) was found in the prolog of the document.| @: org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:255)| @: org.apache.axiom.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMDocumentImpl.java:132)| @: org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:539)| @: com.ibm.broker.axis2.SoapUtilities.wrapDataInSoapEnvelopeIfRequiredAvoidingAxis2(SoapUtilities.java:1762)| @: com.ibm.broker.axis2.Axis2Invoker.prepareToSendReplyNonSOAP(Axis2Invoker.java:1064)| @: com.ibm.broker.plugin.MbOutputTerminal._propagate(Native Method)| @: com.ibm.broker.plugin.MbOutputTerminal.propagate(MbOutputTerminal.java:107)| @: com.ibm.xsl.mqsi.XMLTransformNode.evaluate(XMLTransformNode.java:1015)| @: com.ibm.broker.plugin.MbNode.evaluate(MbNode.java:1469)|Frame : 1 javax.xml.stream.XMLStreamException: An invalid XML character (Unicode: 0x1f) was found in the prolog of the document.| @: com.ibm.xml.xlxp2.api.stax.msg.StAXMessageProvider.throwWrappedXMLStreamException(StAXMessageProvider.java:76)| @: com.ibm.xml.xlxp2.api.stax.XMLStreamReaderImpl.produceFatalErrorEvent(XMLStreamReaderImpl.java:2013)| @: com.ibm.xml.xlxp2.api.jaxb.JAXBXMLStreamReader.produceFatalErrorEvent(JAXBXMLStreamReader.java:316)| @: com.ibm.xml.xlxp2.scan.DocumentScanner.reportFatalError(DocumentScanner.java:4886)| @: com.ibm.xml.xlxp2.scan.DocumentScanner.reportFatalError(DocumentScanner.java:1213)| @: com.ibm.xml.xlxp2.scan.DocumentScanner.scanProlog(DocumentScanner.java:1778)| @: com.ibm.xml.xlxp2.scan.DocumentScanner.nextEvent(DocumentScanner.java:1324)| @: com.ibm.xml.xlxp2.api.stax.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:586)| @: com.ibm.xml.xlxp2.api.stax.XMLInputFactoryImpl$XMLStreamReaderProxyImpl.next(XMLInputFactoryImpl.java:183)| @: com.ibm.xml.xlxp2.api.wssec.WSSXMLInputFactory$WSSStreamReaderProxy.next(WSSXMLInputFactory.java:55)| @: org.apache.axiom.om.impl.builder.StAXBuilder.parserNext(StAXBuilder.java:567)| @: org.apache.axiom.om.impl.builder.StAXOMBuilder.nextToken(StAXOMBuilder.java:634)| @: org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:175)| @: org.apache.axiom.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMDocumentImpl.java:132)| @: org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:539)| @: com.ibm.broker.axis2.SoapUtilities.wrapDataInSoapEnvelopeIfRequiredAvoidingAxis2(SoapUtilities.java:1762)| @: com.ibm.broker.axis2.Axis2Invoker.prepareToSendReplyNonSOAP(Axis2Invoker.java:1064)| @: com.ibm.broker.plugin.MbOutputTerminal._propagate(Native Method)| @: com.ibm.broker.plugin.MbOutputTerminal.propagate(MbOutputTerminal.java:107)| @: com.ibm.xsl.mqsi.XMLTransformNode.evaluate(XMLTransformNode.java:1015)| @: com.ibm.broker.plugin.MbNode.evaluate(MbNode.java:1469) /</Inserts>
</Exception>
</ErrorMessage> |
|
|
Back to top |
|
 |
Vitor |
Posted: Mon Aug 24, 2015 11:13 am Post subject: Re: An invalid XML character (Unicode: 0x1f) was found |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
visasimbu wrote: |
Is there any clue on this exception |
Well there's the one that you reference in the subject:
visasimbu wrote: |
Code: |
javax.xml.stream.XMLStreamException: An invalid XML character (Unicode: 0x1f) was found in the prolog of the document. |
|
Two likely causes are:
- there's some kind of non-standard header / rubbish / random data at the start of the response you're getting back; I notice you're using an HTTPRequest node to parse XML so I suspect a web service that's so non-standard you can't use a SOAPRequest node, and is in fact so non-standard the XML sucks;
- the XML is identified as being in one encoding but is in fact in another (see my comments above about non-standard service); so the XML is described as being in an ISO Latin page but is in fact UTF-8 / UTF-16 with a BOM _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Aug 24, 2015 11:23 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I wonder what a SOAPReply node will do with an HTTP header? _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
Vitor |
Posted: Mon Aug 24, 2015 11:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
I wonder what a SOAPReply node will do with an HTTP header? |
Ooooo.............
Code: |
Error Making SOAP JNI Call: method_com_ibm_broker_axis2_Axis2Invoker_prepareToSendReplyNonSOAP |
I salute you sir!
@visasimbu - is the lack of a node between the HTTPRequest and the SOAPReply a typo or actually what your flow looks like? If that's actually your flow, why do you think you don't need to process the response from the an HTTP service before using it as the reply to a SOAP request? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
visasimbu |
Posted: Mon Aug 24, 2015 12:43 pm Post subject: |
|
|
 Disciple
Joined: 06 Nov 2009 Posts: 171
|
Apologies !
I have compute node before soapReply node which build the soap header and body while replying.
In this error condition flow get struck in the HTTP request node itself and it is going to the error handling. |
|
Back to top |
|
 |
visasimbu |
Posted: Mon Aug 24, 2015 1:03 pm Post subject: |
|
|
 Disciple
Joined: 06 Nov 2009 Posts: 171
|
Issue got resolved.
Thanks mqjeff and Vitor !
Issue -
Input soap message has header as "Accept-Encoding: gzip,deflate" but "HTTP Request node" does not have checked for the property "Accept compressed responses by default".
In my error response says "Unicode: 0x1f" was found which usually a gzip.
Solution -
I have altered my source input in soap ui by removing "Accept-Encoding" http header.
I believe i can also resolve the issue by selecting the property "Accept compressed responses by default" in the HTTP request node. |
|
Back to top |
|
 |
|