Can we call a flow service in a java service

Hi gurus

Can we call a flow service in a java service ? I am new to webMethods can any one help me in this regard

Yes. The easiest way to do this for Integration Server:

  1. In Developer, select the service you want to call.
  2. Select Tools | Generate Code… from the menu.
  3. Select “For calling this service from another service” and click Next.
  4. Select the options desired and click Next.

The code will be placed on the clipboard. You can paste it into your Java service.

You mention that you’re new to Integration Server, so I’d offer that you may want to be wary of doing too much work within Java services. People new to IS tend to want to write Java services when they don’t have to. Of course there are times when Java must be used but for most integration tasks, it doesn’t.

HTH.

Agree with Rob, here. The “normal” pattern is for Flow services to invoke Java services when a specific task can be accomplished more elegantly in Java.

While there are times when you need larger Java services, a very big portion of most integration projects can be completed almost entirely using Flow with occasional calls to a custom library of very small, fine-grained java services specific to your needs.

There are times when you need to invoke a Flow using a Java service, but this should be the exception rather than the rule and should not be viewed as a way to keep from learning/leveraging the strengths of Flow. Doing this is working against the tool not with the tool and will lead to higher maintenance costs and less ROI from your company’s WM investment.

One case in which I’ve used a java service to invoke a flow is the service I always have in my toolbox that will invoke either a Flow or java service on its own thread.

HTH,

Mark

You can invoke flow Service or even java service within a java service using Service.doInvoke()

Best way is generate code using webMethods’s generate code function.

where can I get webMethods realtime example for practice purpose please help

For better performance sometimes Java services are better than flow services.

First I would like to underline the previous statements to consider carefully whether and when to use Java services and calls back to flow.
Having said that: If you need interaction between Java and flow you should consider App Platform in the newer versions of webMethods. This allows a lot between integration between flow and Java, as it offers both sides a native experience, you can generate Java classes with getter and setters from flow and flow for Java classes without the need to use the generated code which imho is a bit cumbersome. With App platform you get a more native experience for both sides (Java and flow developers).