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

2

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?

Player answered 7/12, 2010 at 22:25 Comment(0)
P
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)

Player answered 7/12, 2010 at 23:16 Comment(0)
L
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

Larimer answered 11/3, 2016 at 11:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.