on 2019 Aug 09 8:59 AM
Hello,
we're on SAP PO 7.5 SP14, and struggle with REST receiver adapter. We've a REST service, which returns HTTP 302 with location in header, AND a payload with some additional data. Currently the receiver is setup with module parameters:
ProceedRedirects = false
useResponseErrorMessage = true
setAppErrorOnCustomMessage = true
Result handler is set for Exception - custom result, message content is only {http_result}.
However, the response is always empty. I've browsed through notes 2273265, 2238546 and 2223623 and I think my setup should be OK, but it's not working as expected.
Any suggestion on howto to achieve to NOT follow redirect and send the payload to sender ? When I try in postman/soap ui everything works.
EDIT: I've tried to generate some other error than HTTP 302 - http_result is filled properly (I've tried 403), but whenever I trigger 302, it's empty.
Also in my original post I mentioned incorrect module parameter - setAppErrorOnCustomMessage is the one that should allow me to use http_result during custom error handling, but's not working as expected.
This:
Produces proper output:
{ "status": { "statusCode": "ERROR_VALUE_INVALID", "code": 8062, "codeLiteral": "INVALID_AUTH_FOR_THIS_ORDER", "statusDesc": "Permission denied for given action" } }
While 302:
Produces empty response. But in Postman there's a payload!
Settings:
The problem was finally solved with note 2837075 (https://launchpad.support.sap.com/#/notes/2837075)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So after some time we've found the problem (after decompilation of com.sap.aii.adapter.rest.ejb.jar and looking to the code) - we think the problem is in REST adapter, where the ProceedRedirects = false throws an exception, and during exception, variables http* are not filled.
So we've raised an incident to SAP.
However, since we need a solution, we've developed a custom REST adapter, which was basically a copy of the decompiled .jar, and fixed few lines of code so that the ProceedRedirects do not throw exception.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Some thoughts / questions on that, because I haven't really got your requirement.
Cheers
Jens
Ad 1) REST service returns HTTP 302 and location in header + Payload, that has some data, that are NOT in the location where it's redirected, therefore, we need to process this payload. Also, the location have to be returned to sender (which is an application that can't consume the REST service directly due to security reasons)
Ad 2) I can't comment whether it makes sense or not, but according to RFC 7231 HTTP 302 response can contain payload, and with current options in SAP REST adapter, this payload is not accessible. And there are many services, that works like this.
Also I would like to suggest to have a look at my all time favorite tool XPI Inspector (anybody getting bored by this boilerplate text of mine already?)
https://launchpad.support.sap.com/#/notes/1514898
I find it an invaluable asset when it comes to narrowing down issues in communication channels / modules / mapping or even other areas like SSL.
Cheers
Jens
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
63 | |
10 | |
7 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.