Calling External Web Services in Parallel

Hello everyone,

I am working on a use case and i need to call three external web services in parallel and consolidate the response into one.
What is the quickest way to do this in WM?

  • Vaibhav

Create a BPM process with a parallel gateway and a join, this way you get the parallel execution out of the box without specific coding.

Yes, you can go either by pub-sub and BPM.

Thanks,

Also try transformers if that helps.

Thanks Martin and MR for your reply. I will try these options but as of now I am more interested in writing a JS that helps me achieve this. I could find that we have to do it by calling Service.doThreadInvoke() and indeed it works but now I am faced with problem where I need to send a list to inputs when calling the service via dothreadInvoke(). I cannot find a method that actually accepts array as input. … doThreadInvoke(String ifc, String svc, IData input)
Any help with regard to this?

Hi Mahesh,

I doubt if transformer will give me parallel execution…

  • Vaibhav

What’s the idea behind transformers? They won’t be executed in parallel and having an external call inside a transformer will lead to difficult error handling and some other problems as well.

I try to avoid usage of dothreadInvoke as much as possible. Using this service you need to take care of a lot of things the system can handle for you. The standard patterns for parallel execution inside webMethods ESB is either using a BPM process or publish subscribe. Beside beeing easier to implement those patterns allow distribution on several different servers.

They don’t. The order of execution is not defined, therefore most people advise to assume they are executed in parallel, but in fact, they aren’t.

Just a try if not go with other options as suggested.

Using transformers is not the right option for this need. Go either by BPM or pub-sub or try a different approach.

Thanks,