根据JAVA WebService的WSDL生成.net WebService服务器端代码注意
时间:2010-09-21 来源:AchieveLuo
前几天需要根据java的WSDL写一个.net WebService,发现java的WebService的SopaAction为设为了空,在.net里面也把各SoapAction设为空后,调用就会报错:
System.Web.Services.Protocols.SoapException:方法 serviceConsumeNotify 和 orderRelationUpdateNotify 使用相同的 SOAPAction“”。当 XML Web service 的 RoutingStyle
为 SoapAction 时,SOAPAction 值在 XML Web service 的所有方法中必须是唯一的。可以通过 SoapDocumentMethod 或 SoapRpcMethod
属性的 Action 参数更改 SOAPAction,也可以在 XML Web service 上指定 RequestElement 的 RoutingStyle。
at System.Web.Services.Protocols.SoapServerType..ctor(Type type, ProtocolsEnum versionsSupported)
at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
根据错误提示,在WebService的类名前面加上:
[SoapDocumentService(RoutingStyle = SoapServiceRoutingStyle.RequestElement)]
解决了这个问题, 在这里记一下,怕记了。
相关阅读 更多 +