You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by tim yesno <ti...@gmail.com> on 2010/09/08 14:23:57 UTC
CXF 2.3.0: Shutdown a client which is connected with SOAPoverJMS
Hello
I have a client, the following source code:
ApplicationContext applicationContext = new
ClassPathXmlApplicationContext(APPL_CONFIG);
JaxWsProxyFactoryBean factory =
applicationContext.getBean(CLIENT_FACTORY, JaxWsProxyFactoryBean.class);
MyServiceInterface client = (MyServiceInterface)factory.create();
String reply = client.greetMeString("Hans");
LOGGER.info(reply);
reply = client.greetMeString("Ruedi");
LOGGER.info(reply);
How can I shutdown or disconnect from the broker without making an exception
on the service side (not System.exit()!)?
Thanks for your help.
Regards
tim
Re: CXF 2.3.0: Shutdown a client which is connected with SOAPoverJMS
Posted by tim yesno <ti...@gmail.com>.
Hi Daniel
Thanks for your hint.
Works like a charm.
Regards
Tim
On Wed, Sep 8, 2010 at 4:41 PM, Daniel Kulp <dk...@apache.org> wrote:
> On Wednesday 08 September 2010 8:23:57 am tim yesno wrote:
> > Hello
> >
> > I have a client, the following source code:
> > ApplicationContext applicationContext = new
> > ClassPathXmlApplicationContext(APPL_CONFIG);
> > JaxWsProxyFactoryBean factory =
> > applicationContext.getBean(CLIENT_FACTORY, JaxWsProxyFactoryBean.class);
> > MyServiceInterface client = (MyServiceInterface)factory.create();
> > String reply = client.greetMeString("Hans");
> > LOGGER.info(reply);
> > reply = client.greetMeString("Ruedi");
> > LOGGER.info(reply);
> >
> > How can I shutdown or disconnect from the broker without making an
> > exception on the service side (not System.exit()!)?
> >
> > Thanks for your help.
>
> One of the issues with the jaxws spec is there isn't anything on the client
> to
> mark it as "finished". For CXF, you can try:
>
> org.apache.cxf.frontend.ClientProxy.getClient(client).destroy();
>
> If that doesn't work, please log a bug. That should call close() on the
> conduit which should completely cleanup it's connections and such.
>
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
>
Re: CXF 2.3.0: Shutdown a client which is connected with SOAPoverJMS
Posted by Daniel Kulp <dk...@apache.org>.
On Wednesday 08 September 2010 8:23:57 am tim yesno wrote:
> Hello
>
> I have a client, the following source code:
> ApplicationContext applicationContext = new
> ClassPathXmlApplicationContext(APPL_CONFIG);
> JaxWsProxyFactoryBean factory =
> applicationContext.getBean(CLIENT_FACTORY, JaxWsProxyFactoryBean.class);
> MyServiceInterface client = (MyServiceInterface)factory.create();
> String reply = client.greetMeString("Hans");
> LOGGER.info(reply);
> reply = client.greetMeString("Ruedi");
> LOGGER.info(reply);
>
> How can I shutdown or disconnect from the broker without making an
> exception on the service side (not System.exit()!)?
>
> Thanks for your help.
One of the issues with the jaxws spec is there isn't anything on the client to
mark it as "finished". For CXF, you can try:
org.apache.cxf.frontend.ClientProxy.getClient(client).destroy();
If that doesn't work, please log a bug. That should call close() on the
conduit which should completely cleanup it's connections and such.
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog