axis webservice .settimeout

WebService客户端settimeout的作用
介绍了在WebService客户端,settimeout用于设置接收服务器端响应的最长等待时间,这是信息技术中WebService相关的重要知识。

settimeout 在webservice的客户端是用来设置接收服务器端的响应的最长等待时间

package com.ckkbatch.batchutil; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import org.apache.axis.encoding.XMLType; import javax.xml.namespace.QName; import javax.xml.rpc.ParameterMode; import javax.xml.rpc.ServiceException; import java.rmi.RemoteException; import java.util.Date; public class CkkInterface { private static String url= CKKPropertiesUtil.name; private static Service serv = new Service(); private static Call call; static { try { call = (Call)serv.createCall(); } catch (ServiceException e) { throw new RuntimeException(e); } call.setTargetEndpointAddress(url); call.setUseSOAPAction(true); call.setTimeout(new Integer(5000000)); call.setSOAPActionURI("webservice"); call.setOperationName(new QName("webservice","onSendMessage")); call.addParameter("bsId", XMLType.XSD_STRING, ParameterMode.IN); call.addParameter("bsMsg", XMLType.XSD_STRING, ParameterMode.IN); call.setReturnType(XMLType.XSD_STRING); } public static String Webservice(String bsId,String bsMsg) { String remag=""; // try { //// call = (Call)serv.createCall(); //// call.setTargetEndpointAddress(url); //// call.setUseSOAPAction(true); //// call.setTimeout(new Integer(5000000)); //// call.setSOAPActionURI("webservice"); //// call.setOperationName(new QName("webservice","onSendMessage")); //// call.addParameter("bsId", XMLType.XSD_STRING, ParameterMode.IN); //// call.addParameter("bsMsg", XMLType.XSD_STRING, ParameterMode.IN); //// call.setReturnType(XMLType.XSD_STRING); // System.out.println(bsId); // System.out.println(bsMsg); // remag = (String)call.invoke(new Object[]{bsId,bsMsg}); // } catch (RemoteException e) { // // TODO Auto-generated catch block // e.printStackTrace(); // } try { return (String)call.invoke(new Object[]{bsId,bsMsg}); } catch (RemoteException e) { throw new RuntimeException(e); } } }
最新发布
07-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值