Author |
Message
|
edasnarik |
Posted: Wed Mar 24, 2010 5:13 am Post subject: Encoding Problem with SOAP Message. |
|
|
Acolyte
Joined: 10 Mar 2009 Posts: 61
|
<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault xmlns:axis2ns13="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>axis2ns13:Client</faultcode><faultstring>Character Set Encoding from transport information [UTF-8] does not match with character set encoding in the received SOAP message [windows-1252]</faultstring><detail><Exception>org.apache.axis2.AxisFault: Character Set Encoding from transport information [UTF-8] does not match with character set encoding in the received SOAP message [windows-1252]
at org.apache.axis2.builder.BuilderUtil.validateCharSetEncoding(BuilderUtil.java:786)
at com.ibm.broker.axis2.SoapUtilities.createSOAPMessage(SoapUtilities.java:1988)
at com.ibm.broker.axis2.Axis2Invoker.invokeAxis2OverHTTP(Axis2Invoker.java:1873)
at com.ibm.broker.axis2.TomcatNodeRegistrationUtil.invokeAXIS2(TomcatNodeRegistrationUtil.java:302)
</Exception></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope> |
|
Back to top |
|
 |
Vitor |
Posted: Wed Mar 24, 2010 5:42 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Are you boasting? Or was there a question?
The highlighted error seems clear enough. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
edasnarik |
Posted: Wed Mar 24, 2010 6:28 am Post subject: |
|
|
Acolyte
Joined: 10 Mar 2009 Posts: 61
|
The Error is clear.. But I am not sure on where the changes have to be made .
WSDL ?
Message Set ?
Code ?
Please help me on this. Thanks. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Mar 24, 2010 6:38 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
edasnarik wrote: |
But I am not sure on where the changes have to be made . |
Input XML. Either change the declaration to match the character encoding of the body, or code the body with the encoding given in the declaration. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
edasnarik |
Posted: Wed Mar 24, 2010 12:17 pm Post subject: |
|
|
Acolyte
Joined: 10 Mar 2009 Posts: 61
|
Environment : Broker6.1
If in the XML Declaration , encoding is given as UTF-8 , it is working perfectly fine.
edited post
But the end system is sending with encoding as windows-1252 in the declaration
<?xml version="1.0" encoding="windows-1252"?>
end of edited post
Our service is developed as a part of migration and we cannot ask the end services to change their declarations.
So Option1 is ruled out.
As soon as a message reaches the SOAP Input Node, it is validating Character Set and only then creating the SOAP Message else it is generating a fault message. So the message is not even coming to the next node so that I can change the encoding for subsequent processing..
Failure terminal of SOAPInput is not connected.
Message Domain : SOAP with XMLNSC.
Please let me know of any thoughts on this. Please help.
Last edited by edasnarik on Wed Mar 24, 2010 8:24 pm; edited 3 times in total |
|
Back to top |
|
 |
Vitor |
Posted: Wed Mar 24, 2010 12:26 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
edasnarik wrote: |
Please let me know of any thoughts on this. |
You're doomed?
If the xml declaration says that the document is utf-8 and that's not actually the code page in use for the payload then nothing you can do will make them match. A document in this state is not well formed under the XML rules. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Mar 24, 2010 12:37 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
A potential workaround is to receive the document using a plain HTTP input node and then do an internal SOAPRequest to call the actual web service SOAPInput node. This will allow you to manipulate the content of XML declaration before you validate it against the WSDL.
However, you may not have any reasonable method of determining if the XML declaration is wrong or not - you may only be able to assume that it needs to be UTF-8 if it says anything else.
This could lead to the same failure.
As my esteemed colleague says, if the sender is creating an XML document that is in windows-1252 but is labelling the document as containing UTF-8, then this is an illegal XML document.
There is also a defect in this area, where the HTTP transport headers specify a different codepage than the XML document. If that is the issue you are experiencing, please open a PMR. |
|
Back to top |
|
 |
edasnarik |
Posted: Wed Mar 24, 2010 8:05 pm Post subject: |
|
|
Acolyte
Joined: 10 Mar 2009 Posts: 61
|
Vitor wrote: |
You're doomed? |
Yes . We were expecting in UTF-8 but they are sending in some other windows-1252 encoding.
mqjeff wrote: |
assume that it needs to be UTF-8 |
That is what we are doing.
mqjeff wrote: |
the sender is creating an XML document that is in windows-1252 but is labelling the document as containing UTF-8 |
No
Our Service is by default configured for UTF-8. But the sender is sending in windows-1252. I have edited my previous post to make it more clear.
If in the XML Declaration , encoding is given as UTF-8 , it is working perfectly fine.
BUT we are getting encoding as windows-1252 , which is creating problem.
Hope I am clear now. |
|
Back to top |
|
 |
edasnarik |
Posted: Fri May 07, 2010 7:56 pm Post subject: |
|
|
Acolyte
Joined: 10 Mar 2009 Posts: 61
|
Changes were made in one end point to make that encoding as UTF-8 instead of windows-1252.
But the other endpoint has encoding UTF-16.. How should I code my body accordingly ?
Pls help.
HTTP/1.1 500 Internal Server Error
Content-Type: text/xml;charset=utf-8
Content-Length: 1014
Date: Sat, 08 May 2010 03:53:14 GMT
Server: Apache-Coyote/1.1
Connection: close
Code: |
<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault xmlns:axis2ns8="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>axis2ns8:Client</faultcode><faultstring>Character Set Encoding from transport information [UTF-8] does not match with character set encoding in the received SOAP message [utf-16]</faultstring><detail><Exception>org.apache.axis2.AxisFault: Character Set Encoding from transport information [UTF-8] does not match with character set encoding in the received SOAP message [utf-16]
at org.apache.axis2.builder.BuilderUtil.validateCharSetEncoding(BuilderUtil.java:786)
at com.ibm.broker.axis2.SoapUtilities.createSOAPMessage(SoapUtilities.java:2135)
at com.ibm.broker.axis2.Axis2Invoker.invokeAxis2OverHTTP(Axis2Invoker.java:1931)
at com.ibm.broker.axis2.TomcatNodeRegistrationUtil.invokeAXIS2(TomcatNodeRegistrationUtil.java:302)
</Exception></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope> |
|
|
Back to top |
|
 |
|