首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

cxf文件

2012-11-18 
cxf资料压缩 http://opensourceforce.org/forum/viewthread.php?tid2759超时和附件上传http://cxf.547215

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.

热点排行