I want to make two webservices communicate to each other. Lets say we have two Web services App1 and App2.
I want that App1 could call any function of the App2.
I searched a lot on this server but i couldn't find anything useful for me.
Please help me and thank you in advance for any anwsers.
The standard way to access a web service is through HTTP, but it sounds as if you're asking about a Java method call ... ? If so, refactor the services so that their access logic (that deals with HTTP) is in a separate class from their business logic. Then you can instantiate the business logic classes wherever and whenever you need to.
the thing you written sounds perfect but the problem is that i don't know how to achieve this. I have this from WSDL generated web service which i added the code. but i dont fully understend the separation from access logic and the bussines logic. the thing i made is that the a App1PortType.java which has al the
@webservice settings. Then i made a main funcion App1.java and in web.xml mad a connection to this App1.java so that there are the function that inherit the code.
Here is some code about my two classes
this is my app1
The actual requirement is not to call the other WS, it is to execute the logic that the other WS would execute, correct?
So you should move all the code that is currently in the "/* SOME CODE */" section to its own class that does not depend on any WS API. Then you can use that class directly, without having to call any WS.
Ok i made it!!!
Here is the tutorial how to expose the service ( create a client )
http://px.pats.no/px/Eclipse_tutorial.html And then you just add these files into you service make the connections, program whatever you want and compile it and load it onto your server and it works!!!
If any question just ask.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop