on 04-15-2009 1:23 PM
Hi,
I have a HTTP Receiver scenario. I get the data from a Webservice and sent the data with a HTTP Request to our customer. So far we have no problem. Our customer is returning a payload structure like the one below.
Now the problem here is, there is a <start>, <end> tag and "0" and "OK" before and after the XML structure as you can see below. How can I parse these type of messages?
<start>
0
OK
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE AMS_XML_DATA SYSTEM "Group1.dtd"><AMS_XML_DATA><Header><ErrorCode>0</ErrorCode><ErrorMessage>OK</ErrorMessage><Version>1.0</Version><SourceId>XXX</SourceId><MessageId>XXX99998888777766665555</MessageId></Header><Segment><IgnoreFg></IgnoreFg><ErrorCode>555</ErrorCode><ErrorMessage>PR DA FO</ErrorMessage><TransactionType>N</TransactionType><TransactionId>XXX99998888777766665555</TransactionId></Segment></AMS_XML_DATA>
<end>
Thank you in advance.
Best Regards,
Arman
use a java mapping. Extract the substring which contains the XML only and then initiate a parser.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use prolog and epilog concepts. For more details about prolog and epilog concept see the below link.
[ http://help.sap.com/saphelp_nw70/helpdata/EN/44/79973cc73af456e10000000a114084/content.htm];
Regards,
Prakasu.M
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think to parse this message is impossible, because it's not well formed.
<start>
0
OK
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE AMS_XML_DATA SYSTEM "Group1.dtd"><AMS_XML_DATA><Header><ErrorCode>0</ErrorCode><ErrorMessage>OK</ErrorMessage><Version>1.0</Version><SourceId>XXX</SourceId><MessageId>XXX99998888777766665555</MessageId></Header><Segment><IgnoreFg></IgnoreFg><ErrorCode>555</ErrorCode><ErrorMessage>PR DA FO</ErrorMessage><TransactionType>N</TransactionType><TransactionId>XXX99998888777766665555</TransactionId></Segment></AMS_XML_DATA>
<end>
A declaration of DOCTYPE outside the header / prolog is not allowed.
Aditionally the start and end tags are not closed. So the basic question is, why does the sender transfers a not well formed XML?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.