|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Invalid XML character from SAP Inbound adapter |
« View previous topic :: View next topic » |
Author |
Message
|
RangaKovela |
Posted: Tue Nov 10, 2015 2:59 am Post subject: Invalid XML character from SAP Inbound adapter |
|
|
Apprentice
Joined: 10 May 2011 Posts: 38
|
Hi Experts,
Environment IIB9.0 Windows OS.
Scenario :
Flow 1:
SAP Inbound Adapter - > IDOC REceived is routed to MQ by adding MQ Header - > MQ Output node
MQ Header added as below :
CCSID : MQCCSI_UNICODE_1208 (to handle UNICODE characters)
Format : MQFMT_NONE
Flow 2:
MQ Input Node - > Parse the IDOC using DataObject (XMLNS parser) and update SQL DB .
Problem :
We are receiving ' &' and other special characters from SAP for certain IDOCS. SAP is unable to escape these characters due to which IDOC is failing with XML parsing errors in the Flow 2.
As per my understanding XMLNS/XMLNSC parser is capable of escaping special characters like '& < >. This is not happening in this case. Could you please advice?
Thanks, |
|
Back to top |
|
 |
timber |
Posted: Tue Nov 10, 2015 3:42 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Quote: |
Parse the IDOC using DataObject (XMLNS parser) |
I think you mean XMLNSC. I hope you do, anyway.
Quote: |
We are receiving ' &' and other special characters from SAP for certain IDOCS. SAP is unable to escape these characters... |
Please explain. I am 99.9% sure that SAP can output valid XML, if configured correctly. So you must be talking about some specific scenario.
Please quote the exact XML, and explain why SAP cannot make it valid.
Quote: |
As per my understanding XMLNS/XMLNSC parser is capable of escaping special characters like '& < > |
That is correct. Both of those parsers will parse & as a literal &. Both will automatically convert & to & when writing, in places where that is required. But that is not relevant to this discussion. If the message flow is receiving a badly-formed XML message then there is nothing that IIB ( or any other application ) can do about that. |
|
Back to top |
|
 |
RangaKovela |
Posted: Thu Nov 12, 2015 1:31 am Post subject: |
|
|
Apprentice
Joined: 10 May 2011 Posts: 38
|
Quote: |
Quote:
Parse the IDOC using DataObject (XMLNS parser)
I think you mean XMLNSC. I hope you do, anyway.
|
Parser is set as DataObject. Dataobject invokes XMLNS/XMLNSC parser internally.
Quote: |
Quote:
We are receiving ' &' and other special characters from SAP for certain IDOCS. SAP is unable to escape these characters...
Please explain. I am 99.9% sure that SAP can output valid XML, if configured correctly. So you must be talking about some specific scenario.
Please quote the exact XML, and explain why SAP cannot make it valid |
SAP is sending us XML with tags like below :
<IndSectorDesc>Engineering & Construction</IndSectorDesc> IIB flows are failing parse such XML document .
When my flow is trying to read such tags, parser error is thrown.
Some observations :
Tried opening XML document in RFHUTIL(Parsed mode) - RFHUtil is able to display it without any error.
Tried opening same XML document in Chrome browser- I can see XML is not well formed.
Tried using trace nodes - Can see XML document till the tag with special character logged in file.
When running Debug mode- Can see XML document till tag with special character and later it shown as 'XML parsing errors occurred'
Not sure why SAP is unable to escape special chars in XML. We are waiting for SAP feedback on this |
|
Back to top |
|
 |
timber |
Posted: Thu Nov 12, 2015 2:36 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
XMLNS and XMLNSC are different parsers. DataObject uses XMLNSC.
SAP is sending invalid XML, and there is nothing that IIB can do about that. ( Globally replacing & with & is not safe because you could accidentally corrupt some other part of the document ).
All you can do is wait for SAP's response, and then insist that they emit well-formed XML. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|