cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

HTTP to HTTPs scenario in SAP CPI - Error 404

nidhi_srivastava22
Active Contributor
0 Likes
3,477

Hi Experts,

There is a requirement where we are sending a json payload to HTTPs receiver URL and getting the below error.

1) Added the P12 key with passphrase in the keystore. Connection tested and working fine.

2) While posting the json payload from Postman, it is working fine and getting a response 202 as accepted, but while triggering through CPI it is showing error.

Error Details com.sap.it.rt.adapter.http.api.exception.HttpResponseException: An internal server error occured: HTTP operation failed invoking https://13b6XXXXXX with statusCode: 400. The MPL ID for the failed message is : AF-Xsgygs

3) The payload format is mentioned as below.

Request:{ "ABC":"1111111", "MMM":[31,10,15,80,80,34,56,23,34], "XYZ":"2222222" }

Response: [ { "code": 202, "XYZ": "2222222", "ABC": "11111111" } ] -> this bracket can be an issue?

Please suggest where I am going wrong, and suggest to resolve the same.

Thanks,

Nidhi Srivastava

Accepted Solutions (1)

Accepted Solutions (1)

Hi nidhi.srivastava22,

In addition to what Sri suggested could you please check what is the Content-Type set before posting data.

thanks and regards,

Praveen T

nidhi_srivastava22
Active Contributor
0 Likes

The content type is set to application/json while triggering the data from Postman.

Content-Type: application/json

Thanks,

Nidhi Srivastava

nidhi_srivastava22
Active Contributor
0 Likes

Hi Praveen,

This is working fine, once we have added the Content-Type - application/json in the content modifier before passing it to the Receiver.

Thanks,

Nidhi Srivastava

Answers (1)

Answers (1)

Sriprasadsbhat
Active Contributor

Hello Nidhi,

Don't think response is the issue.Could you try clearing headers ( in case of unwanted headers your server gives 400 ).

https://blogs.sap.com/2018/01/18/sap-cpi-clearing-the-headers-reset-header/

Regards,

Sriprasad Shivaram Bhat

nidhi_srivastava22
Active Contributor
0 Likes

Hi Sriprasad,

I tried adding as per your suggestion, but still getting the same error.

Error Details com.sap.it.rt.adapter.http.api.exception.HttpResponseException: An internal server error occured: HTTP operation failed invoking https://XXX with statusCode: 400. The MPL ID for the failed message is : AF-NbvK2ZZ


Please suggest.

Thanks,
Nidhi Srivastava