0
votes

Does WebSphere 8.5 (Java EE 6) support in any way services (Servlets, EJBs,...) acting as clients to another RESTFul WebService? E.g. by managing their HTTP connections?

The only link I've found so far is some supprt for services acting as clients to another JAX-RCP webservice using the ibm-webservicesclient-bnd.xmi descriptor:

http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp%2Fae%2Frwbs_assembpropclient.html

http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/twbs_configaddhttppropertiesatk.html

Is there a client descriptor for RESTFul webservice clients, which could be used from a service?

EDIT

To make it more clear what I'm looking for:

Currently we create a RESTFul client in the service using WebResource, ApacheHttpClient, ApacheHttpClientHandler from Jersey and HttpClient from Apache. This is done programmatically, not declaratively, so WebSphere is not aware of these clients and the connections/ sockets they are using.

I'm looking for a way to create clients with resources managed by WebSphere, so I could do somehing like:

@Resource
private SomeResource someResource;

....

SomeClient client = new SomeClient(someResource);

or something similar. It could be something WebSphere specific. There could also be another way to get the resource than to inject it with @Resource.

But it should be WebSphere who manages and creates the max. number of connections, sockets, timeouts, pooling etc. and should allow to monitor these resources.

So something similar as we're using with JMS when we want to send messages to a topic or a queue:

@Resource
private ConnectionFactory connectionFactory;

@Resource
private Topic someTopic;

@Resource
private Queue someQueue;

Just that this time we want to send a request to another RESTFul webservice.

1
@Stefoan I don't think this answers my question. I'm not asking how create a RESTFul webservice client but how to manage its resources (such as HTTP connections/ sockets) if a service itself acts as as RESTFul webservice client.Puce
Can you please state more precisely what you are looking for? I guess your questing isn't easy to understand. (btw, i didnt downvote)Stefan
@Stefoan Please see my edited question. Is it more clear now?Puce

1 Answers

0
votes

Unfortunately, with WAS 8.5, you can't.

WAS 8.5 (or even the latest, 8.5.5) supports Java EE 6.0 and JAX-RS 1.2. The JAX-RS 1.2 specification only deals with JAX-RS from the "server" point of view (that is, hosting RESTful services), but not the "client" point of view.

Therefore, with WAS 8.5, your only choice for JAX-RS client programming is using proprietary APIs and libraries such as the ones you're using. You can of course wrap those APIs in such a way that you can inject connections (possibly using CDI), but it's not available for you out of the box.

WAS 8.5 ships with a REST client, though - Apache Winks.