Thanks for the hints guys. I'll look into the system properties for URLConnection as Dan suggests -- I'd rather load them from the web as we're doing a dynamically configurable service manager thing. I guess one other option if that doesn't work is to try to create each service in a separate thread which we can abandon after a given interval.
Andrew. On 18/02/2009, Dale Ogilvie <[email protected]> wrote: > > 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:[email protected]] > Sent: Thursday, 19 February 2009 7:19 a.m. > To: [email protected] > 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 <[email protected]>: >> > 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 > [email protected] > http://www.dankulp.com/blog > -- :: http://biotext.org.uk/ ::
