• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Web Service Multiple Endpoints

 
Fernando Nos
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I use a java application to make a web service call. After some changes was decided that this same application should be able to decide, having multiple endpoints, which endpoint to call. These endpoints point to instances of the same web service. I used AXIS when I developed it. Could anyone helping me on changing it? How can I modify the application so it can decide what endpoint to use, to check if an endpoint is not responding.

Thanks
 
R Srini
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I am trying to understand this. So please help me. This is my understanding of an endpoint:

- Say you have an ordering service at this endpoint http://yourcompany.com/services/OrderingService.
- And it provides three operations: placeOrder, cancelOrder and viewOrder.

Relative to the above endpoint, can you take an example of another endpoint where you might need to decide between the two? If you referring to different versions of the service, then this might help: http://www.ibm.com/developerworks/webservices/library/ws-version/
 
Fernando Nos
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok. So now let`s say that this service is deployed in more than one machine, using managed servers. And now I want to make my java application to, before calling, check if the service is available in the endpoint. If it`s not, then it should try the next one.

http://yourcompany.com/services/OrderingService.

MyCompanyServer 1 - OrderingService - http://yourcompany.com/services/server1/OrderingService
MyCompanyServer 2 - OrderingService - http://yourcompany.com/services/server2/OrderingService

Is it clearer now?
 
R Srini
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, that gives a better idea. If you are referring to clustering in a group of servers to provide higher availability than with a single server, then you could look into the documentation of your server because this is specific to the provider. Here are a few links for GlassFish and Axis:

GlassFish v2: http://developers.sun.com/appserver/reference/techart/glassfishcluster/
GlassFish v3 (not sure if v3 supports clustering yet): http://wiki.glassfish.java.net/Wiki.jsp?page=GlassFishV3Clustering
Axis2/Tomcat: http://www.swview.org/node/182
Tomcat: http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html

Or if clustering is not an option, then you can still have multiple ports (which are the same as endpoints) in a single wsdl. To be clear, I haven't tried this myself making it up as I go along but you can have multiple endpoints a.k.a. ports in a WSDL, each specifying a different address, but using the same binding:

And of course, servers usually have a method in there to check whether they are running. For example, Axis has an isRunning() method.

So maybe this is what you are looking for. In this case, if a wsdl generator does not generate multiple ports for the same address, then you might have to manually modify the wsdl and then use a static wsdl. LOL. If you try this out, please let me know if it works.

All said, with what you are trying to achieve, clustering is probably a better fit as it directly addresses your problem without any additional code on your part. Of course, there will be the clustering configuration work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic