cancel
Showing results for 
Search instead for 
Did you mean: 

Sending Plain Text via HTTP

udo_martens
Active Contributor
0 Kudos

Hi,

i want to send a plain text message to a http receiver. The receiver format (called JSON) looks like (example):

{

    "currency": "EUR",

    "fromCurrency": "NOK",

    "exchangeRate": 0.89042,

    "exchangeRateDate": "2010-02-28 00:00:00"

}

I m able to create that result with xsl (Java or ABAP is as well possible) but the PI runtime is adding a prolog and comment like:

<?xml version="1.0" encoding="UTF-8"?>

<!-- Request Operation Mapping -->

and so the request is failing.

Do you have any idea how i can send a plain text message via http?

Best regards,

Udo

Accepted Solutions (1)

Accepted Solutions (1)

udo_martens
Active Contributor
0 Kudos

Hi,

it was actually an application error - the added PI lines (prolog / comment) are obviously only parts of PI monitoring. That means: You can use http adaper in comibination with xsl, java or abap mapping.

Thanks all for your help,

Udo

Answers (2)

Answers (2)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Your JSON structure does not seem so complicated. You might try using java mapping.  I would also try using StrictXML2PlainBean module in the receiver adapter and see if that helps. I have seen using this in the  file receiver adapter. I think you can give a try using in http receiver and give us your updates.

udo_martens
Active Contributor
0 Kudos

Hi Baskar,

i really appreciate your quick answer

I m using PI 7.1., so the module is not available for http. I will check out the module using the soap adapter.

Best regards,

Udo

former_member181985
Active Contributor
0 Kudos

Hi Udo,

I think XSLT mapping has a tendency (not 100% sure) to add XML declaration and comment line by mapping run time. Try with java mapping.

If java mapping case also produces the same result, then you should go for custom module to remove these lines and use module either with java HTTP adapter (assuming you have latest PI) or with SOAP adapter with Do not use SOAP envelope option.

Regards,

Praveen Gujjeti

udo_martens
Active Contributor
0 Kudos

Hi Praveen,

thanks a lot for your promt answer

I will first check out if an ABAP dummy mapping is producing the prolog/comment too. Then i need to go for soap adapter (i m on PI 7.1). I m a bit concerned the soap adapter might change the payload by using escape sequences or something like that.

Best Regards,

Udo

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Udo,

I m a bit concerned the soap adapter might change the payload by using escape sequences or something like that.

The payload sent in the HTTP Body is sent as is (what you see in the payload after request message mapping).

For HTTP POST, maybe my blog can help See page 22

http://scn.sap.com/docs/DOC-29829

Hope this helps,

Mark