6

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?

Adam
  • 3,675
  • 8
  • 45
  • 77

2 Answers2

4

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)

Community
  • 1
  • 1
Adam
  • 3,675
  • 8
  • 45
  • 77
2

I think we can cache stub using org.apache.commons.pool2.impl.GenericObject lirbrary.

Please see the below link for the same.

https://github.com/vikashnitk50/fasypay-webservice-client/tree/master/fasypay-webservice-client/src/main/java/com/fastpay/webservice/client

VIKASH SINHA
  • 250
  • 3
  • 17