Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to cache JAX-WS stub/port in Java?

Tags:

caching

jax-ws

The use case is that the application (running on JBoss 5) must operate on very limited bandwidth. Currently every time we go to make a webservice call we request the wsdl and recreate the stub using JAX-WS. Each time the stub is created the wsdl and schema is redownloaded. Idealy the wsdl would never be downloaded since we already have a copy of the schema, but even caching would work. Bonus points if the cache is Serializable!

Is it possible to cache a JAX-WS stub/port?

like image 221
Adam Avatar asked Dec 07 '10 22:12

Adam


1 Answers

Best answer found so far:

Tell the service to look at a local wsdl: JAX-WS client : what's the correct path to access the local WSDL?

Change the endpoint on the fly: JAX-WS Loading WSDL from jar


I don't see a way to cache, but using a local copy can be done as specified on this page on metro: Developing client application with locally packaged WSDL

(found on SO question : How to cache a WSDL with Java-WS)

like image 120
Adam Avatar answered Sep 18 '22 15:09

Adam