0
我有下面的代码,我正尝试通过使用Apache CXF通过HTTPS访问web服务。但是,只要我的信息消失,我的代码超时之前我什么也收不回来。有人可以给我的代码一次,让我知道如果我做错了什么。我试图通过SoapUI访问服务,这很好,所以它必须是我的CXF代码中的东西,但我只是不知道该怎么做!CXF&SSL:超时问题
感谢所有帮助
DepositImplService ss = new DepositImplService(WSDL_LOCATION,
SERVICE_NAME);
PortType port = ss.getPortTypePort();
Client client = ClientProxy.getClient(port);
HTTPConduit conduit = (HTTPConduit) client.getConduit();
HTTPClientPolicy httpClientPolicy = conduit.getClient();
httpClientPolicy.setConnectionTimeout(30000);
httpClientPolicy.setReceiveTimeout(30000);
conduit.setClient(httpClientPolicy);
AuthorizationPolicy authPolicy = new AuthorizationPolicy();
authPolicy.setUserName("foo");
authPolicy.setPassword("bar");
conduit.setAuthorization(authPolicy);
TLSClientParameters parameters = new TLSClientParameters();
parameters.setSecureSocketProtocol("SSL");
conduit.setTlsClientParameters(parameters);
client.getInInterceptors().add(new LoggingInInterceptor());
client.getOutInterceptors().add(new LoggingOutInterceptor());
UploadRequestT doc = new UploadRequestT();
BufferedReader reader = new BufferedReader(new FileReader(new File(
"C:\\rawmessage.txt")));
String documentStr = "";
String currLine = "";
while ((currLine = reader.readLine()) != null) {
documentStr += currLine;
}
doc.setDoc(documentStr);
doc.setOwner("43");
port.upload(doc);
响应时间几乎是瞬间。监视工具的好主意 - 我会看看是什么告诉我的。 – 2009-04-30 10:59:35