on ‎2016 Jun 28 7:12 AM
Hi All,
I have a scenario where I need to host a REST service using GET operation and there are 2 optional parameters (let's call them a and b).
Since this is GET operation, I am not expecting any HTTP payload in body. I have configured the sender rest channel to convert data to XML and add wrapper of Message type name (refer screenshots). I have done request mapping to hard code a few parameters.
However, if I send a GET message to the service using a rest client with no payload, I receive an error (MP: exception caught with cause com.sap.aii.adapter.xi.routing.RoutingException: Unable to parse XML message payload to extract operation for receiver determinationorg.xml.sax.SAXParseException: Premature end of file.). PI doesn't seem to like empty HTTP body even in case of GET operation.
Also noticed that:
Am I doing something wrong here?
Regards,
Sanjeev.
Message was edited by: Sanjeev Shekhar Singh
Request clarification before answering.
I dont have a REST adapter on my landscape and hence while not a direct answer, Why not use the plain HTTP_AAE Adapter with the GET method?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Bhavesh,
I have to return the response as JSON and also response volume is a bit high, so didn't want to tinker around with Java mapping too much to perform conversion. But I agree, this is an alternative.
My main intention was to understand if this is the intended behavior of rest adapter (not handling empty payload for GET operation), or am I doing something wrong in the configuration.
Regards,
Sanjeev
I definitely understand the need to use a Standard Approach. Would have also done the same.
What you require from the REST Adapter that it accepts a Empty Payload for a HTTP GET seems to be a valid ask! From the looks of your error, it doesnt seem to be acceptable to PI ( I wish I could try this ) and hence a OSS to SAP might be the answer
Regards
Bhavesh
I just checked my notes for a previous REST Demo and I was actually able to use a REST Scenario with a GET call with no payload.Below is what my configuration looks like,
Is this the same configuration you use? If yes,Would suggest if there are any patches around the same, have a look on Service Market Place.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.