Handle a SoapFault in a web service

1
0
-1

Hi everyone,

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.

2 answers

1
0
-1

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

thank you

Comments

Submitted by Sean McP on Mon, 05/18/2015 - 13:42

That's far to SOAP specific for me, I can't help, sorry.

1
0
-1

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

etc.

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...

regards

Comments

Submitted by amine250 on Mon, 05/18/2015 - 10:36

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

Submitted by Sean McP on Mon, 05/18/2015 - 10:39

That's what I would do, yes, I don't think there's any other way of doing it. Anyone?

regards

Submitted by amine250 on Mon, 05/18/2015 - 10:44

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! :)

Submitted by Sean McP on Mon, 05/18/2015 - 11:32

Not a problem and good luck with the final piece,

there is a lot to software engineering, it's an interesting subject.

regards

Notifications