我用java调用.net的web service已经没有问题了,代码:
[SoapRpcMethod(Action="http://myhost/myService",
 RequestNamespace="http://myhost/myService",
 ResponseNamespace="http://myhost/myService"),
WebMethod]
public String MyMethod1()
{
return "MyMethod1";
}
但是如果我的web service公开了两个方法的话,代码:
[SoapRpcMethod(Action="http://myhost/myService",
 RequestNamespace="http://myhost/myService",
 ResponseNamespace="http://myhost/myService"),
WebMethod]
public String MyMethod1()
{
return "MyMethod1";
}[SoapRpcMethod(Action="http://myhost/myService",
 RequestNamespace="http://myhost/myService",
 ResponseNamespace="http://myhost/myService"),
WebMethod]
public String MyMethod2()
{
return "MyMethod2";
}java调用就会出错:
System.Web.Services.Protocols.SoapException: 方法 MyMethod1 和 MyMethod2 使用相同的 SOAPAction“http://myhost/myService”
但是我将Action换成其它的值,都不行。怎样分别设置我的.net下的web service两个方法中的SoapRpcMethod的Action值才不会出错了?谢谢!