[英]Message=Server did not recognize the value of HTTP Header SOAPAction: error
HI Guys, I have created a web service. 嗨,大家好,我已经创建了一个Web服务。 And I m able to hit the web service using SOAPUI but when i try to call through my code I get this error.
而且我可以使用SOAPUI来访问Web服务,但是当我尝试通过代码调用时,会出现此错误。 Any ideas?
有任何想法吗?
ok the web service code looks like this: 好的,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)
{
}
And my client code is: 我的客户代码是:
Search _search = new Search();
_search.url;
_search.n.wcred;
_search.searchAsset(request);
This solved my problem with the SoapAction: 这解决了我与SoapAction的问题:
[SoapDocumentService(RoutingStyle = SoapServiceRoutingStyle.RequestElement)]
SoapServiceRoutingStyle Enumeration SoapAction The SOAP message is routed based on the SOAPAction HTTP header. SoapServiceRoutingStyle 枚举 SoapAction SOAP消息基于SOAPAction HTTP标头进行路由。 RequestElement The SOAP Message is routed based on the first child element following the XML element of the SOAP message.
RequestElement SOAP消息基于SOAP消息的XML元素之后的第一个子元素进行路由。
The most common cause I've heard of this is that the value in whatever the real code of: 我听说过的最常见原因是无论实际代码中的值如何:
[WebService(Namespace = "http://Search")]
If this value isn't what the server expects, the error message you report will happen. 如果此值不是服务器期望的值,则会发生您报告的错误消息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.