Handle a SoapFault in a web service
I'm using a web service in my process.
I would like to handle the case when an error occurs, and the SOAP response contains the SoapFault tag.
Concretely, in the input I have an identifier of a person. In the output, I should have infos about that person. If there's no person with that identifier, the web service returns a response with SoapFault. How can I warn the process user about that?
I'm using Bonita CE 6.5.1. Thank you in advance.
hi @amine and @Sean McP
im doing also my graduation internship with bonita ,can you please check my last post, im stuck to connecting to a webservice that return several lists also @amine can you give me your email so we can share documents to help us with our graduation
That's far to SOAP specific for me, I can't help, sorry.
When you say the web service returns a response, is that back the the bonita process? If so then just flag that as an error and start an error processing routine which you build into your process.
Your process isn't a fully defined process if you haven't allowed for the necessary error conditions that could be raised or handled.
By my way of thinking the process you have is...
enter data go get soap info do something else do something else
when what you really want is
enter data if data error - do error routine //numbers only? Alphanumeric etc. your data rules else go get soap info if soap not active - do error routine //soap not responding? what happens if this is the case else if soap response data not found - do error routine //record not found error routine, what happens if this is the case else if ... else if ... you need to add as nay as necessary to ensure you have a valid response..., what happens if this is the case else //valid response do something else do something else end if
You don't say how you want this process to operate...is this on submit button or before? each design has it's own specific way of doing things...
First, thank you as always for your answer :)
So basically, I should treat the error (if it occurs) in the script that parse the XML response?
And then in the process depending on the contents of my returned variable (after the parsing), I will show the user the informations or the error?
Please correct me if I'm understanding it wrong. Regards
Well, thank you for that Sean, you've been a real help to me during my graduation internship, it's almost come to the end! :)