1. string requesturl = "/http" + urlStr + "/vippushdata/" SYNCSERVICEIMPLPORT?WSDL "; Try {url baseurl = syncserviceimplservice.class.getresource (". "); Url url = new url (Baseurl, requesturl); Syncserviceimplservice service = new syncserviceimplservice (Url, new QName ("http ://webservice.vip.centaur.com/", " Syncserviceimplservice ")); Syncserviceimpldelegate porttype = service.getsyncserviceimplport ();((BindingProvider) PortType). Getrequestcontext (). Put ("Com.sun.xml.ws.request.timeout", integer.valueof ());(( Bindingprovider) porttype). Getrequestcontext (). Put ("Com.sun.xml.ws.connect.timeout", integer.valueof (10000)); Return porttype.sync (data);} catch (exception e) {throw new faiureexception (Messageformat.format ("call" {0} " Exception occurred, number of retries {1}, exception information: {2} ", Requesturl, 0, e.getmessage ()));} Set timeout, does not take effect. 2. Solution: Settings: system.setproperty (" Sun.net.client.defaultConnectTimeout ", " 10000 "); System.setproperty ("Sun.net.client.defaultReadTimeout", "10000");
JAX-WS Client Application timeout setting