on 04-17-2020 11:26 AM
Hi experts,
My scenario is a simple SOAP call. In case of an error, the SOAP web service returns 500/Internal Server Error response. It's an XML containing the fault message. I want to catch this fault message and perform additonal processing on it like sending it over to a Message Mapping step. I want to do this instead of using ${exception.message} and ${exception.stacktrace} because the fault message contains more info about the error. However, I can't seem to fetch it. It's showing up when I enable the trace but it doesn't even go to the exception subprocess. I've tried ticking Return HTTP Response Code as Header in the adapter and also ${header.CamelHttpResponseCode} but to no avail.
Has anyone managed to accomplish this? Appreciate any tips and tricks. Thanks!
Hello Mark,
It seems that currently, the only option is using an HTTP receiver adapter.
Regards,
Fatih
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark,
Glad it works. I thought the same about SOAP adapter handling. By the way, SAP recently announced a continuous influence program for CPI to get feedback. You may be interested in the program: https://influence.sap.com/sap/ino/#/campaign/2282/ideas
I've looked up a solution for this exact problem and made a blog post about it.
Fetch SOAP Fault/Error Response from Receiver in SAP Cloud Platform Integration | SAP Blogs
With this script, there is no need anymore for a workaround with a HTTP Adapter.
Cheers
Dennis Sentler
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How did you do this ?
2. Wrap your request message body in SOAP Envelope in a Content Modifier before calling the adapter.
Regards,
Rolf
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
This can be handled by exception subprocess and writing a groovy script to capture exception class returned as mentioned in https://help.sap.com/viewer/368c481cd6954bdfa5d0435479fd4eaf/Cloud/en-US/a443efe1d5d2403fb95ee9def1a.... Once the class is captured, run the method ex.getDetail() and it will return you the full payload passed from SOAP Fault.
Thanks,
Aditya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dennis,
Yes, I used the exact solution which is mentioned in the blog with just that I ended up converting to OutputStream byte array. However, if you are sending the payload a XML body as a response (which I have encountered earlier) the w3c.Dom Document works well with SOAP / HTTP adapters.
Hope this helps 🙂
Thanks,
Aditya
Have you tried using trace and saw any values in the header/property?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try using request-reply to call this server and exception handling in the same integration process block with trace enabled, later restore the value of header/property which carries fault exception in the content modifier body inside exception sub-process, hoping after this step you use mapping to handle and let community knows your findings.
Thanks,
Chandan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chanda, Thanks for responding. Yes my iFlow is exactly like this - 1 integration process with request-reply and an exception subprocess. What header/property should I use to get the fault exception? This is my problem. I already tried ${in.body}, ${exception.message} and even CamelHttpResponseCode, which I expect to be 500, doesn't go to the exception subprocess. It goes back to my question - how can I fetch and bring over the fault message returned by the SOAP receiver into the exception subprocess?
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.