欢迎来到天天文库
浏览记录
ID:16746600
大小:61.50 KB
页数:11页
时间:2018-08-24
《cxf请求webservice超时区分》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、CXF请求超时区分设置超时代码JaxWsDynamicClientFactoryclientFactory=JaxWsDynamicClientFactory.newInstance();Stringurl="http://192.168.1.56:7001/test?WSDL";ClientclientTemp=clientFactory.createClient(url);HTTPConduithttp=(HTTPConduit)clientTemp.getConduit();HTTPClientPolic
2、yhttpClientPolicy=newHTTPClientPolicy();httpClientPolicy.setConnectionTimeout(10);//连接超时httpClientPolicy.setAllowChunking(false);//取消块编码httpClientPolicy.setReceiveTimeout(1000);//响应超时http.setClient(httpClientPolicy);Object[]arg;Stringresult="";try{arg=client
3、Temp.invoke("testMothd","8698053");result=(String)arg[0];}catch(Exceptione){e.printStackTrace();}这部分代码大家在网络上随便搜索都能得到,这个就是CXF设置连接的超时与响应时间的方法。当然小编主要讲的不是这个,主要来说下到底如何区分连接超时,还是响应超时。分析请求错误(5大种)创建Client类时,URL无效Exceptioninthread"main"org.apache.cxf.service.factory.S
4、erviceConstructionException:CouldnotresolveURL"http://www.qq.com/e?WSDL".atorg.apache.cxf.endpoint.dynamic.DynamicClientFactory.composeUrl(DynamicClientFactory.java:566)atorg.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.
5、java:253)otherstaffoftheCentre.Duringthewar,ZhuwastransferredbacktoJiangxi,andDirectorofthenewOfficeinJingdezhen,JiangxiCommitteeSecretary.Startingin1939servedasrecorderoftheWestNorthOrganization,SecretaryoftheSpecialCommitteeAfterthevictoryofthelongMarch,he
6、hasbeentheNorthwestOfficeoftheFederationofStateenterprisesMinister,ShenmufuguSARmissions,DirectorofNingxiaCountypartyCommitteeSecretaryandrecorderoftheCountypartyCommitteeSecretary,Ministersandatorg.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClie
7、nt(DynamicClientFactory.java:198)atorg.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:191)atorg.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:146)atClientTest.soap(ClientTest.
8、java:141)atClientTest.main(ClientTest.java:167)Causedby:java.io.FileNotFoundException:http://www.qq.com/e?WSDLatsun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:
此文档下载收益归作者所有