Skip to Content
0

Unable to parse XML message payload to extract operation for receiver - Rest Adapter

Jul 31, 2017 at 12:37 PM

1.2k

avatar image

Hi All,

I am working on a scenario Rest Async - > PI -> File where I am getting data in JSON format . I have configured my sender channel as Async Rest also configured Operation Determination but I am getting below error

Unable to parse XML message payload to extract operation for receiver determinationorg.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.


Reference -

https://archive.sap.com/discussions/thread/3693248

https://archive.sap.com/discussions/thread/3924907

https://blogs.sap.com/2015/10/26/exposing-rest-service-with-multiple-operations-in-sap-po-with-rest-adapter/

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Karthik Bangera Aug 02, 2017 at 06:27 AM
2

Hi Rudra,

You can try the below message type structure which will also allow you to have multiple records. Probably the inbuilt JSON to XML converter of REST Adapter expects the message structure to be in a certain format as below. This one works well for me :)

And then the channel configuration can be as below-

Lastly, you can do a POST from either Postman or SOAPUI using the below end point -

http:<myHost>:<myPort>/RESTAdapter/FltTest

and the payload as (multiple occurrences for Record node)-

{

"Record": [{ "AirlineID": "A123", "ConnID": "A123", "Date": "20111988" } ,

{ "AirlineID": "A234", "ConnID": "A234", "Date": "20112017" } ]}

Let me know if it works for you :)

Regards,

Karthik Bangera


messagetype.jpg (35.7 kB)
ch-general.jpg (65.7 kB)
ch-selection.jpg (25.6 kB)
ch-resources.jpg (23.8 kB)
ch-op.jpg (28.4 kB)
Show 2 Share
10 |10000 characters needed characters left characters exceeded

Thanks Karthik,

It worked I have changed the channel configuration suggested and the issue is not with the structure. I was using PI internal test tool and Postman for message posting and It was not getting posted properly.

When I tested it with SOAP UI , It worked fine.

Thanks a lot for the help.

Warm Regards,

Rudra

0
Former Member

Thanks Karthik,

You brought me great help.

Warm Regards,

rubin

0
avatar image
Former Member Jul 31, 2017 at 02:22 PM
0

Check your JSON data format. Dat might have some JSON formatting issue, hence REST sender channel is failing to convert this to XML or there might have some characters in JSON data parameter which is not allowed in XML tag.

Thanks,

Apu

Show 6 Share
10 |10000 characters needed characters left characters exceeded

Hi Apu,

Thanks for the reply.

I am sending very simple structure with only 3 fields and all 3 field are string and there is no such character as well.

Warm Regards,

Rudra

0

Hi Apu,

Please find the screen shot of fields and payload .

Payload -

{ "AirlineID": "A123", "ConnID": "A123", "Date": "20111988" }

Regards,

Rudra

fields.png (7.6 kB)
0
Former Member

Can you please share you REST sender CC configuration screen shot.

Thanks,

Apu

0

H Apu,

It is already attached in thread . Please let me know if I am missing any configuration.

Warm Regards,

Rudra

0
Former Member
Rudra Singh

Hi Rudra,

Everything looks fine to me. I can't see any config issue in CC.

Can you try below once -

Under Channel selection tab - select limit to HTTP Operation with GET operation.

Thanks,

Apu

0

Thank you Apu,

But I am still getting the same error .

Regards,

Rudra

0