您的位置:首页 > 运维架构 > Linux

(转载)centos6.5下安装mysql

2015-09-05 14:27 381 查看
/**
* QQ在线状态查询
*/
public static void main(String[] args) {
//设置代理
System.getProperties().put("proxySet", "true");
System.getProperties().put("proxyHost", "192.168.0.26");
System.getProperties().put("proxyPort", "808");
//设置socket代码
System.getProperties().put("socksProxySet", "true");
System.getProperties().put("socksProxyHost", "192.168.0.26");
System.getProperties().put("socksProxyPort", "1080");
try {
//WebServices服务地址
String endpoint = "http://www.webxml.com.cn/webservices/qqOnlineWebService.asmx";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));

//要调用的方法名
call.setOperationName("qqCheckOnline");
//设置调用方法参数
call.addParameter(new javax.xml.namespace.QName("http://WebXml.com.cn/",
"qqCode"), org.apache.axis.encoding.XMLType.XSD_STRING, String.class,
javax.xml.rpc.ParameterMode.IN);

//设置返回类型
call.setReturnClass(String.class);
/**
//new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema"
//, "string")或org.apache.axis.encoding.XMLType.XSD_STRING都可以
//设置返回类型
call.setReturnType(new javax.xml.namespace.QName(
"http://www.w3.org/2001/XMLSchema", "string"));
//返回参数名
call.setReturnQName(new javax.xml.namespace.QName(
"http://WebXml.com.cn/", "qqCheckOnlineResult"));
**/

call.setUseSOAPAction(true);
call.setSOAPActionURI("http://WebXml.com.cn/qqCheckOnline");

//http://WebXml.com.cn/ 命名空间
call.setOperationName(new javax.xml.namespace.QName(
"http://WebXml.com.cn/", "qqCheckOnline"));

String k = (String) call.invoke(new Object[] { "285336157" });
System.out.println("result is " + k.toString() + ".");
} catch (Exception e) {
e.printStackTrace();
}

}
 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: