• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to connect two Web services to each other

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everybody.

I have a problem:

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.

lp, Mesni
 
Ales Mesni
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I forgot to say that we are using WASCE and im going to install MQseries but i dont know if this could help me achieve my goal
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ales Mesni
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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


and this is my appPortType


and example would be grait

thank you for your help
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ales Mesni
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much for the reply.
So i have to create a different class and add the functions in there and then the other WS app2 that runs on the same WASCE can only include the files from this WS?

I dont understand the part when the WS app2 gets the classes of the app1.

Lp, Mesni
 
Ales Mesni
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Lp, Mesni
reply
    Bookmark Topic Watch Topic
  • New Topic