Author |
Message
|
SandiSan |
Posted: Thu Jul 14, 2011 8:27 pm Post subject: Issue with Parsing Russian Character |
|
|
 Acolyte
Joined: 01 Apr 2006 Posts: 57 Location: Pune/India
|
Hi,
I am having problem parsing xml message containing Russian Character . I am receiving xml as a response from webservice call using HttpRequest Node. I am using XMLNSC domain.
Message comes out of of 'OUT' terminal of Httprequest node. However, the xml is not getting parsed.
From the webservice appln logs i garbed the xml. This is how it looks
<?xml version="1.0"?>
<RusResp xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://gis.deere.com/Lookup/RusResp RusResp.xsd" street="??????? ????? 15" city="??????" state="�����" postalCode="125267" country="RU" xmlns="http://gis.deere.com/Lookup/RusResp">
<AddressCandidate x="" y="" matchType="ADDRESS_POINT" score="0" matchAddress="??????? ????? 15 ??????, ����� 125267, RU" xmlns="http://gis.deere.com/Lookup/Geocode" />
</RusResp>
Please let me know you suggestions to handle this issue.
Thanks
Sandisan |
|
Back to top |
|
 |
ayanc |
Posted: Fri Jul 15, 2011 1:37 am Post subject: |
|
|
Voyager
Joined: 15 Nov 2004 Posts: 88
|
Sandy,
I guess you need to see if UTF-16 works for you. Use a SOAP UI and set the encoding. Send the request and check the response (RAW format).
If the response hex values are correct in SOAP UI then you need to enforce the encoding in WMB.
Hope this helps.  |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Jul 15, 2011 2:01 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
If this problem is in the data you have received from another webservice then you need to get the other webservice changed.
It might be as little as adding the UTF-16 tag to the header line
<?xml version="1.0"?>
If the incoming data is incorrectly formed then broker can do nothing about it.
Possibly something like this
Code: |
<?xml version="1.0" encoding="UTF-16"?>
|
As has been suggested sort it out using SOAP/UI. Then go back to the webservice devs and get them to change their end. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
eugen |
Posted: Fri Jul 15, 2011 5:54 am Post subject: |
|
|
Novice
Joined: 28 Dec 2010 Posts: 22
|
Well.. SandiSan mentioned on linkedin that it is not a webservice call after all, but some "xml over http" (is it me or does it sound like REST?)
If it's REST-ful web service call, then I have no idea if broker can handle that over usual SOAPInput, it is not a SOAP service so I would say "nope", you should use a HttpRequest node most probably, but then again you are already using one. Might need to test this out, and yes, I am kind interested in the problem since I am pretty sure will face it sometime soon
In any case Sandisan, you probably need to articulate your issue a bit better and I am sure that people here are going to help you out.
Cheers,
Eugene. |
|
Back to top |
|
 |
rekarm01 |
Posted: Fri Jul 15, 2011 11:40 am Post subject: Re: Issue with Parsing Russian Character |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
SandiSan wrote: |
I am having problem parsing xml message containing Russian Character. |
Is there an error message associated with the problem?
SandiSan wrote: |
From the webservice appln logs i garbed the xml. This is how it looks
<?xml version="1.0"?>
<RusResp ... state="�����" ... matchAddress=" ... ����� ... " ... />
</RusResp> |
Regardless of the character encoding, null characters are not allowed in XML messages. |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Jul 15, 2011 11:47 am Post subject: Re: Issue with Parsing Russian Character |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
rekarm01 wrote: |
SandiSan wrote: |
I am having problem parsing xml message containing Russian Character. |
Is there an error message associated with the problem?
SandiSan wrote: |
From the webservice appln logs i garbed the xml. This is how it looks
<?xml version="1.0"?>
<RusResp ... state="�����" ... matchAddress=" ... ����� ... " ... />
</RusResp> |
Regardless of the character encoding, null characters are not allowed in XML messages. |
Это не может быть истинно! _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
rekarm01 |
Posted: Fri Jul 15, 2011 1:33 pm Post subject: Re: Issue with Parsing Russian Character |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
smdavies99 wrote: |
rekarm01 wrote: |
Regardless of the character encoding, null characters are not allowed in XML messages. |
Это не может быть истинно! |
Это верно.
null characters are not legal XML characters. They cannot appear in a well-formed XML document, not even as character references. |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Jul 15, 2011 11:15 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
If you have the CCSID and/or Decoding totally wrong you will see NULLS.
Perhaps your phrase should read as follows
Quote: |
Regardless of the character encoding, null characters are not allowed in VALIDXML messages.
|
_________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
SandiSan |
Posted: Sat Jul 16, 2011 3:15 am Post subject: |
|
|
 Acolyte
Joined: 01 Apr 2006 Posts: 57 Location: Pune/India
|
Problem was with '�' character which is an invalid XML character. I read the httpresponse as BLOB then convert it to CHAR and removed '�' then finally convert it to XMLNSC and I was able to get the XMLNSC tree created without any parse error.
I appreciate all you help and suggestions
Thanks
Sandisan |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Jul 16, 2011 7:21 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
SandiSan wrote: |
Problem was with '�' character which is an invalid XML character. I read the httpresponse as BLOB then convert it to CHAR and removed '�' then finally convert it to XMLNSC and I was able to get the XMLNSC tree created without any parse error.
I appreciate all you help and suggestions
Thanks
Sandisan |
Not sure at all that that was the right thing to do. Did you check whether the response was in UTF-16 or UTF-32? My guess is that the response you received as a BLOB is in a CCSID that you did not expect. Removing the resulting hex 0 bytes may work. However I don't know how that would affect a multibyte character...
The better way would be to find out what CCSID is being used and cast the blob accordingly.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
rekarm01 |
Posted: Sun Jul 17, 2011 5:04 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
smdavies99 wrote: |
If you have the CCSID and/or Decoding totally wrong you will see NULLS. |
Null bytes maybe, but not null character references, and not usually 5 in a row. The problem in this case is with the message itself, not with the encoding.
smdavies99 wrote: |
Perhaps your phrase should read as follows
Quote: |
Regardless of the character encoding, null characters are not allowed in VALID XML messages. |
|
"valid" implies conformance to some schema or DTD. null characters aren't allowed in non-valid XML messages either.
SandiSan wrote: |
I read the httpresponse as BLOB then convert it to CHAR and removed '�' |
While that might resolve the immediate parsing problem, it won't replace lost or corrupt data. For that, the sender needs to fix the message at the source. |
|
Back to top |
|
 |
|