cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kjell Winblad <kjell.winb...@digitalroute.com>
Subject Endpoint#stop() does not close opened port and what happen to received requests when it is called?
Date Thu, 22 May 2008 13:31:39 GMT
Hi,

I have two question regarding the closing of services. I have made an
user interface for a webservice and it shall be possible to start and
stop the service from the interface. I use the following code to create
and publish the service:

import javax.xml.ws.Endpoint;
import org.apache.cxf.jaxws.EndpointImpl;

...

GreeterImpl serverImpl = new GreeterImpl()
Endpoint end = Endpoint.create(serverImpl);
EndpointImpl endpoint = (EndpointImpl) end;
endpoint.setWsdlLocation(wsdlfile);
end.publish("http://localhost:6002/WS");

The server uses HTTP as transport and works great. When I check the
opened ports on my machine I can see that CXF has opened the port I
specified in my publish address. The problem occures when I try to stop
the service. I use the the method stop() on my endpont instance. No
exceptions are thrown and it isn't possible to send requests to the
service anymore. So, the stop method seems to work but the opened port
is still open. What is supposed to happen when stop() is called on an
Endpoint, shall the associated port close? If it shall stay open how do
I close a port that has been opened by the Endpoint#publish() method?

The second question is:
What happens with received but not processed requests when
Endpoint#stop() is called? Before the service is stopped I want to be
sure that response messages for all the requests that already have been
recived to the service have been sent. So, does the Endpoint#stop()
method wait until all response messages for incoming request have been
sent before it stops the service?

Thanks in advance,
Kjell Winblad 



Mime
View raw message