当前位置: 代码迷 >> XML/SOAP >> 服务器未能识别 HTTP 头 SOAPAction 的值解决方法
  详细解决方案

服务器未能识别 HTTP 头 SOAPAction 的值解决方法

热度:894   发布时间:2014-02-27 01:51:49.0
服务器未能识别 HTTP 头 SOAPAction 的值
代码如下
//本次调用web服务查询qq在线情况
//接口
public interface InterfaceQQ {
  public String qqCheckOnline(String qq);
}
//实现接口类

public String qqCheckOnline(String qq){
String  resulst="";
//创建服务的元素据
Service srvcModel = new ObjectServiceFactory().create(InterfaceQQ.class);
        //创建服务代理
XFire xfile=XFireFactory.newInstance().getXFire();
XFireProxyFactory factoty = new XFireProxyFactory(xfile);
         
String heUEL ="http://webservice.webxml.com.cn/webservices/qqOnlineWebService.asmx";
InterfaceQQ iClient = null;

try {
iClient = (InterfaceQQ) factoty.create(srvcModel,heUEL);
} catch (MalformedURLException e) {
System.out.print("000");
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
resulst = iClient.qqCheckOnline(qq);
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println(e.toString());
e.printStackTrace();
}



return resulst;
}
//测试类
GetService getService=new GetService();
  String re=getService.qqCheckOnline("17516400");
  System.out.print(re);
兄弟你这个Web Service实现了吗。我也是这个问题。请教一下。
  相关解决方案