cancel
Showing results for 
Search instead for 
Did you mean: 

How to call a second webservice on failure of the first?

Former Member
0 Kudos

I wonder if someone could enlighten me as to the best way of implementing the following scenario on PI/PO 7.4 (i.e. Java only stack) so no ccBPM.

The scenario is we are trying to get a list of products and we have 2 web service enabled systems that can supply this. We check System 1 first and if that doesn't give us a list of products then, and only then, we check system 2. In sequence this would be:

1. Sender Web service -> Receiver Web service 1 to get a list of products.

2. Receiver webservice 1 either returns a fault response or one of it's response fields = 0 (i.e. 0 products)

3. Because we had a fault or 0 products we call Receiver Webservice 2 to get a list of products

4. Response be it a fault or a succesful response is sent back to the calling system.

One important point is all this needs to be synchronous.

Is this a classic case for BPM using gateway conditions? Is that the only way of achieving this or are there options?

Hope this makes sense.

Thanks in advance all!

Accepted Solutions (1)

Accepted Solutions (1)

engswee
Active Contributor
0 Kudos

Hi Pete

The thread below was raised last week with a similar question to yours - not sure if it might be raised by a colleague of yours.

Using BPM is one way to handle this. There is another response in that thread that you can consider too.

Rgds

Eng Swee

Former Member
0 Kudos

No, not a colleague of mine but interesting it's a similar scenario. I could also have the issue where System 1 is down....or simply that System 1 hasn't been updated with the right info so in both cases I need to check system 2.

BPM feels like the right way to go, so I'll check the links and your blog and see if it fits.

I'll make sure to update the question when I'm done.

Thanks alot Eng!

Answers (1)

Answers (1)

iaki_vila
Active Contributor
0 Kudos

Hi Peter,

You can consider to do a SOAP lookup in your scenario response

If your scenario is not a synchronous one, you can do a SOAP lookup in your the request mapping with your first scenario and depending the output determine your second WS or a dummy scenario.

Also, this control could be achieve with the the sender system and depending of the first call, do or not do the second call.

Regards.