spring - Is it necessary to close JAX-WS port? -


In some tutorials (like, and) it suggested to close the JAX-WS port by casting it to com Has been .sun.xml.ws.Closeable example

  MyPortType port = MyService.getMyPort (); ... Do some operations on the WS proxy ... ((com.sun.xml.ws.Closeable) port) .close ();  

This approach will not work for the proxy, as it returns only because it advises only the targeted WS interface and javax.xml.ws.BindingProvider .

So my question is: Is it necessary to close the harbor (keep in mind that this application is reusable)? If it is better to shut down the port (and possibly cancel it?), How to organize the correct life cycle of ports (the spring proxy created by implementation will always be aggregation)?

No, I do not believe it is necessary. It depends on the JDS-WS subsystem to manage its own lifecycle, ports are not to be closed.

This is made up of the behavior of JaxWsPortProxyFactoryBean , if you source code. It does not try to do anything with the port in connection with the shutdown, which will be the spring factory beans usually.


Comments