求大神解答,
webservice客户端代码,
package ws.accountCodeColl;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Logger;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceFeature;
/**
*/
@WebServiceClient(name = "SB_FI_GL_InquiryAccountCodeCombinationSrv", targetNamespace = "http://eip.zte.com/common/gl/SB_FI_GL_InquiryAccountCodeCombinationSrv", wsdlLocation = "http://10.1.55.159:7777/orabpel/fi/SB_FI_GL_InquiryAccountCodeCombinationSrv/1.0/SB_FI_GL_InquiryAccountCodeCombinationSrv?wsdl")
public class SBFIGLInquiryAccountCodeCombinationSrv_Service
extends Service
{
private final static URL SBFIGLINQUIRYACCOUNTCODECOMBINATIONSRV_WSDL_LOCATION;
private final static Logger logger = Logger.getLogger(ws.accountCodeColl.SBFIGLInquiryAccountCodeCombinationSrv_Service.class.getName());
static {
URL url = null;
try {
URL baseUrl;
baseUrl = ws.accountCodeColl.SBFIGLInquiryAccountCodeCombinationSrv_Service.class.getResource(".");
url = new URL(baseUrl, "http://10.1.55.159:7777/orabpel/fi/SB_FI_GL_InquiryAccountCodeCombinationSrv/1.0/SB_FI_GL_InquiryAccountCodeCombinationSrv?wsdl");
} catch (MalformedURLException e) {
logger.warning("Failed to create URL for the wsdl Location: 'http://10.1.55.159:7777/orabpel/fi/SB_FI_GL_InquiryAccountCodeCombinationSrv/1.0/SB_FI_GL_InquiryAccountCodeCombinationSrv?wsdl', retrying as a local file");
logger.warning(e.getMessage());
}
SBFIGLINQUIRYACCOUNTCODECOMBINATIONSRV_WSDL_LOCATION = url;
}
public SBFIGLInquiryAccountCodeCombinationSrv_Service(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
public SBFIGLInquiryAccountCodeCombinationSrv_Service() {
super(SBFIGLINQUIRYACCOUNTCODECOMBINATIONSRV_WSDL_LOCATION, new QName("http://eip.zte.com/common/gl/SB_FI_GL_InquiryAccountCodeCombinationSrv", "SB_FI_GL_InquiryAccountCodeCombinationSrv"));
}
/**
/**
features
parameter will have their default values.}
通过new这个类去创建连接,getSBFIGLInquiryAccountCodeCombinationSrvPort()方法返回调用的接口,
求大神解答怎么设置连接超时和响应的超时
近期使用xfire作为客户端访问WS,结果因为目标主机假死,造成客户端一致无法返回,后续调用也无法进行。更悲催的是采用定时器轮询调用,结果整个定时器都阻塞无法执行后续任务。
跟踪了一下代码发现引起上诉问题的代码出现在此处(红色部分):
public Client loadClient() throws MalformedURLException, Exception{......
答案就在这里:xfire设置连接超时问题
----------------------Hi,地球人,我是问答机器人小S,上面的内容就是我狂拽酷炫叼炸天的答案,除了赞同,你还有别的选择吗?