In some tutorials (e.g. here, here and here) it is suggested to close the JAX-WS port by casting it to com.sun.xml.ws.Closeable
e.g.
MyPortType port = MyService.getMyPort();
... do some operations on WS proxy ...
((com.sun.xml.ws.Closeable) port).close();
This approach will not work for proxies, returned by JaxWsPortProxyFactoryBean
, as it advices only target WS interface and javax.xml.ws.BindingProvider
.
So my question is: Is it necessary to close the port (taking in mind that it is re-usable in application)? If it is better to close the port (and probably nullify it?), how to organize correctly lifecycle of ports (by implementation the created Spring proxies will always be singletons)?