首页新闻找找看学习计划

java客户端调用webservices报错:urn:anonOutInOp

0
悬赏园豆:10 [待解决问题]

刚接触axis,老大给了一个类,自己按照这个类,在本地上写了一个java的webservice接口,然后用下面程序调用是可以的,但是,换成.net提供的接口就有问题。

麻烦大家帮下忙!

代码:

public class getWebService {
public static void main(String args[]){
EndpointReference targetEPR = new EndpointReference("http://59.41.9.39:8088/BYQDataExchange/WebService1.asmx");
Options options = new Options();
options.setTo(targetEPR);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setTimeOutInMilliSeconds(600000);
try
{
ServiceClient serviceClient = new ServiceClient();
serviceClient.setOptions(options);

OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("WebService1", ""); //命名空间
OMElement method = fac.createOMElement("HelloWorld", omNs);//方法名

OMElement result = serviceClient.sendReceive(method);
String response2 = result.getFirstElement().getText();
System.out.println(response2);

}catch(Exception e){
e.printStackTrace();
}
}
}

=====================================================

错误信息:

rg.apache.axis2.AxisFault: Server did not recognize the value of HTTP Header SOAPAction: urn:anonOutInOp.
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:517)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:371)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:539)
at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:520)
at getWebService.main(getWebService.java:39)

言易解道的主页 言易解道 | 初学一级 | 园豆:192
提问于:2014-08-09 23:58
< >
分享
所有回答(1)
0

请问此问题解决了么?

shadowOnline | 园豆:204 (菜鸟二级) | 2017-08-03 14:39
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册