webservice:
[WebService(Namespace = "http://cs.zmchina-sh.com/webservices/")]
[WebServiceBinding(ConformsTo = WsiProfiles.None)]
[SoapDocumentService(RoutingStyle = SoapServiceRoutingStyle.RequestElement)]
[ToolboxItem(false)]
public class LoginService : System.Web.Services.WebService
{
[SoapRpcMethodAttribute(Action = "http://cs.zmchina-sh.com/webservices/UserLogin", RequestNamespace = "http://cs.zmchina-sh.com/webservices/Request", ResponseNamespace = "http://cs.zmchina-sh.com/webservices/Response")]
[WebMethod(Description="判断用户是否存在,返回True或False")]
public bool UserLogin(string userName,string userPwd)
{
//具体逻辑,返回true或false
}
}
现在JAVA调用就会报错,网上找了好多例子,试了都不行。
报错信息:
SoapFault - faultcode: 'soap:Client' faultstring: 'System.Web.Services.Protocols.SoapException: 无法识别请求元素 <UserLogin xmlns='http://cs.zmchina-sh.com/webservices/UserLogin'>。
现在错误就锁定在这里
[SoapRpcMethodAttribute(Action = "http://cs.zmchina-sh.com/webservices/UserLogin", RequestNamespace = "http://cs.zmchina-sh.com/webservices/Request", ResponseNamespace = "http://cs.zmchina-sh.com/webservices/Response")]
1.请问Action是怎么组成的,我要怎么写。
2.哪里还有错误。
------解决方案--------------------
[SoapDocumentService(RoutingStyle = SoapServiceRoutingStyle.RequestElement)]
换这句协议试试