We have moved to loading local wsdl from file in WEB-INF/classes to
avoid a hung ajp process in tomcat where the wsdl is unavailable.

        URL wsdlURL =
getClass().getClassLoader().getResource("/ourservice.wsdl");

        Service s = new Service(wsdlURL);

Once we have a service, we use the conduit timeouts, which seems to work
for us.

        com.acme.ourservice.ServiceSoap port = s.getServiceSoap12();
        
        Client cl = ClientProxy.getClient(port);

        HTTPConduit http = (HTTPConduit) cl.getConduit();

        HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
        httpClientPolicy.setConnectionTimeout(10000);
        httpClientPolicy.setReceiveTimeout(45000);

        http.setClient(httpClientPolicy);

A question, will the above code fail if CXF ends up using URLConnection
instead?


-----Original Message-----
From: Daniel Kulp [mailto:dk...@apache.org] 
Sent: Thursday, 19 February 2009 7:19 a.m.
To: users@cxf.apache.org
Cc: Andrew Clegg
Subject: Re: [JAX-WS] Setting timeout for Service.create()


 
Right now, the wsdl/schema retrieval just uses the normal 
java.net.URLConnection stuff.   Thus, I THINK there are system
properties that 
can control that.

There IS code in place to use our conduits (HTTPConduit) to get the
wsdl, but it still tries the URLConnection thing first for right now and
only does the conduit thing if that fails, except for https where it
does the conduit thing 
first.   (I was too scared to make it do conduit thing first all the
time, 
probably should re-look at that)


Dan


On Wed February 18 2009 12:09:31 pm Andrew Clegg wrote:
> Anybody have any pointers for this one? Thanks :-)
>
> 2009/2/14 Andrew Clegg <and...@nervechannel.com>:
> > Hi,
> >
> > Not sure if this is a CXF question or a JAX-WS API question...
> >
> > Is there any way to set a timeout for javax.xml.ws.Service.create()
?
> > What happens if the operation to retrieve the WSDL from a remote URL

> > takes forever?
> >
> > Cheers,
> >
> > Andrew.
> >
> > --
> >
> > :: http://biotext.org.uk/ ::

--
Daniel Kulp
dk...@apache.org
http://www.dankulp.com/blog

Reply via email to