`
openstudy
  • 浏览: 233006 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

cxf资料

阅读更多
压缩 http://opensourceforce.org/forum/viewthread.php?tid=2759
超时和附件上传http://cxf.547215.n5.nabble.com/CXF-client-td597616.html

Handling the Apache CXF Java Client Timeout
If you are using CXF, you can control the client timeout by programmatically obtaining the HTTPConduit from the proxy and setting the ConnectionTimeout and ReceiveTimeout properties.

For example:

import org.apache.cxf.frontend.ClientProxy;

import org.apache.cxf.transport.http.HTTPConduit;

import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;

import com.primavera.ws.p6.job.JobPortType;

//...


JobPortType port = testCase.getJobServicePort();

org.apache.cxf.endpoint.Client client = ClientProxy.getClient(port);

HTTPConduit httpConduit = (HTTPConduit)client.getConduit();

HTTPClientPolicy policy = httpConduit.getClient();

// set time to wait for response in milliseconds. zero means unlimited

policy.setReceiveTimeout(0);

Or, you can control the client timeout by modifying the spring configuration for the client http-conduit file.

Please refer to the CXF User's Guide for information about using the http-conduit file to control the client timeout. At the time of this writing, the CXF User's Guide was available at http://cwiki.apache.org/CXF20DOC.
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics