ali*_*ce7 1 c# soap web-services
HI Guys,我创建了一个Web服务.我能够使用SOAPUI访问Web服务但是当我尝试通过我的代码调用时,我得到了这个错误.有任何想法吗?
好吧,Web服务代码如下所示:
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[WebServiceBindingAttribute(Name = "SoapBinding", Namespace = "xyz")]
[System.ComponentModel.ToolboxItem(false)]
[WebService(Namespace = "http://Search")]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class Stub : System.Web.Services.WebService
{
public Stub()
{
Log.Debug(this,string.Format("this is just a test message"));
}
[WebMethod]
public Response searchAsset(Request serviceTag)
{
}
Run Code Online (Sandbox Code Playgroud)
我的客户代码是:
Search _search = new Search();
_search.url;
_search.n.wcred;
_search.searchAsset(request);
Run Code Online (Sandbox Code Playgroud)
这解决了SoapAction的问题:
[SoapDocumentService(RoutingStyle = SoapServiceRoutingStyle.RequestElement)]
Run Code Online (Sandbox Code Playgroud)
SoapServiceRoutingStyle 枚举 SoapAction SOAP消息基于SOAPAction HTTP标头进行路由.RequestElement SOAP消息基于SOAP消息的XML元素之后的第一个子元素进行路由.