Call a java program on a different server

Can someone tell me how I can call a Java Interface (not a Web Service) from webMethods? The Java Application (that has the Interface) is running on a different machine so it would be a remote call…

Thank you!

Hello,
Do you want to do rmi, you can look at the trail here:
[url=“Implementing a Remote Interface (The Java™ Tutorials > RMI)”]JDK 19 Documentation - Home

I think an issue is that you have to implement the interface on the server side and maybe extend a cetain Remote Class. So with that you will would be wise to put this it in a seperate folder from any service not related. Better to make sure it is in a unique top level folder. You also have to make sure you have the right signature implemented for your java methods. WM has a predefined “public static final void”, so you would have to put other methods in under your shared tab. I think that would be right. Good day.

Yemi Bedu

Assuming the java app on the other server is a plain ole java object(POJO) running outside of an application server, the following options might get you where you need to be:

  1. Use webMethods Glue to quickly expose this POJO as a web service and then invoke it from IS. This would require no changes to the existing app and is pretty easy to do following the examples provided with Glue. []Create a wrapper that subscribes to a JMS Queue or Topic and use BrokerJMS to send it a message. The wrapper could then invoke the app and publish its results as a return JMS message. []Same approach as above but use Broker java API instead of JMS. []Rehost the app inside of an application server and use the EJB Adapter or write RMIIOP code to invoke it. []Modify it to be callable via Java RMI and then write RMI client code in an IS java service. [*]As a last resort, you could FTP a file to the external server and have this app poll a folder for some work to do.

HTH,

Mark

Thank you both for your suggestions, they are very helpful!
I am new to webMethods so I don’t have experience with the environment.

I have been thinking about using RMI. Is it easy to use it with webMethods?

Thanks again!

Hi,

I want to write a java program to get the broker data from the IS. This java code will be the external code. How can i get the broker details externally from the IS. I found this thread somewhat relevant.
Please help.

Thank you in advance,
Sumit

Sumit,
You can use the BrokerServerClient and the BrokerAdmin client for this purpose.For API reference you can look into the BrokerAdmin and BrokerClient API guide in the <webmethods_root>\Broker \doc folder.For running the java program from outside you will need to import the COM.actiesw.API.client and have in in your classpath.

HTH…

Thanks,
Puneet Verma

Thanks Puneet, it worked fine.

regards,
Sumit

Are there any new methods of calling the remote java interface? as this post looks to be old and just wanted to understand if there are additional capabilites in webMethods to interact with third party java interface?

The current implementation looks like the point 6 form Mark Carlson post in this thread!

We have the requirement to call a Java service from webMethods IS where the client is expecting minimal/no modification to the application and get rid of the FTP polling mechanism from the program