ITeye博客

cxf资料

openstudy · 2011-04-21 17:50 · webservice · 编程语言 · Markdown

压缩 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.

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。