aspose file tools*
The moose likes Web Services and the fly likes web services, EIS and state Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "web services, EIS and state" Watch "web services, EIS and state" New topic
Author

web services, EIS and state

grigoris philippoussis
Greenhorn

Joined: Oct 22, 2007
Posts: 16
Hi

I want to wrap an EIS (C++ app) and make it available to J2EE componenets.

The service needs to accept calls to init(), start(), stop(), doStuff() etc - so it needs to maintain state. Ideally, it would sit in the background runnning, waiting for requests.

Would it be correct to wrap it in a web-service? Or should I be looking at using a resource adapter?

Thanks,
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Gregory,

Please check your private messages.
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Would it be correct to wrap it in a web-service?


Web services are supposed to be stateless - maintaining any kind of state adversely affects scalability of the service. That doesn't mean that you cannot interact with long-running transactions through web services. It simply means that the state is stored somewhere else (like a database) other than the service. To identify which "state" the service is operating on, you have to include a correlation identifier in every message that follows the initial request that initiates the "conversation".

Given what you have outlined I think that the resource connector is the better solution in your case. It should give better performance than a web service and you can always expose the functionality supported by the connector through a web service hosted within the application server. However the connector needs to be designed carefully. If state is stored within the connector then you need server affinity support because all the request of the same "conversation" (with the same correlation identifier) need to be routed to the same server within a cluster. If you can store the state on the EIS any connector instance on any server will do.
grigoris philippoussis
Greenhorn

Joined: Oct 22, 2007
Posts: 16
thanks.
Do you know of any good RA resources on the net?
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
There are some in this topic.
A search on the EJB and Other Java EE Technologies forum may turn up more.
This article Choosing among JCA, JMS, and Web services for EAI might also be of interest.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: web services, EIS and state