public static void main(String[] args) throws ServiceException, RemoteException {
// TODO Auto-generated method stub String url="http://www.webxml.com.cn/WebServices/WeatherWebService.asmx";
String nameSpace="http://tempuri.org/";
Service service=new Service();
Call call=(Call)service.createCall();
call.setTargetEndpointAddress(url);
call.setOperationName(new QName(nameSpace,"getSupportCity"));
call.addParameter("byprovinceName", XMLType.XSD_STRING, ParameterMode.IN);
call.setUseSOAPAction(true);
call.setReturnType(Constants.XSD_STRING);
call.setSOAPActionURI(nameSpace+"getSupportCity");
String resutlsg=(String)call.invoke(new Object []{"湖北"});
System.out.println(resutlsg);
}上面是调用天气预报WEBservice的 我用C#调用有返回值,说明这些参数没有问题,请问各位大侠,为什么在Java里面就出现 faultString: 服务器未能识别 HTTP 头 SOAPAction 的值: http://tempuri.org/getSupportCity。
这个错误
是命名命名空间的问题还是别的问题
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货