cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronous HTTP error response

steve_coombes
Participant
0 Kudos

Hello,

I have a requirement to accept cXML invoices over HTTP and post to INVOIC01 Idocs via PI 7.4.

I am using a synchronous HTTP communication channel that calls BAPI_INCOMINGINVOICE_CREATE and creates Idocs.

I am making a series of validation checks before calling the BAPI, for example validating the username and password in the request. At the moment I throw a StreamTransformationException if the username and password are invalid, but this means an HTTP 500 error is returned to the client.

I have two mappings, one to map the request from cXML to the BAPI, and one to map the response from the BAPI response to cXML response. If the validation checks fail I would like to return a cXML reponse without calling the BAPI. Is this possible without using BPM?

The error response details would vary depending on which validation error had failed, e,g, authentication error, PO does not exist etc.

Kind regards

Steve

Accepted Solutions (1)

Accepted Solutions (1)

former_member184720
Active Contributor
0 Kudos

>>>>I have two mappings, one to map the request from cXML to the BAPI, and one to map the response from the BAPI response to cXML response. If the validation checks fail I would like to return a cXML reponse without calling the BAPI. Is this possible without using BPM?

I don't think so as it is a synchronous communication. But don't you think it would be easy to handle the validation inside a proxy/FM and then call the BAPI?

Handle your validations inside the proxy and call the BAPI if the validations are successful else return the error messages from the proxy/FM back to PI.

steve_coombes
Participant
0 Kudos


Many thanks Hareesh, that would solve the problem.

Steve

Answers (0)