cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP Receiver -> Response message

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Shabarish_Nair
Active Contributor
0 Kudos

use a java mapping. Extract the substring which contains the XML only and then initiate a parser.

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

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?

Shabarish_Nair
Active Contributor
0 Kudos

>

> I think to parse this message is impossible, because it's not well formed.

thats exactly where a java mapping can help since the incoming payload for the mapping is always treated as an inputsream

Former Member
0 Kudos

Yes - you are right with that ;o)