简体   繁体   English

Message =服务器无法识别HTTP标头SOAPAction的值:错误

[英]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.

相关问题 服务器无法识别HTTP标头SOAPAction的值:“” - Server did not recognize the value of HTTP Header SOAPAction: “” 服务器无法识别 HTTP Header SOAPAction 的值 - Server did not recognize the value of HTTP Header SOAPAction 服务器无法识别HTTP标头SOAPAction启动的值 - Server did not recognize the value of HTTP Header SOAPAction initiate 通过编程方式定义绑定而不是App.Config时出现“ SoapException:服务器无法识别HTTP标头SOAPAction的值” - “SoapException: Server did not recognize the value of HTTP Header SOAPAction” when programmatically defining Binding instead of App.Config System.Web.Services.Protocols.SoapException:服务器无法识别HTTP标头SOAPAction的值: - System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: SQL Server CE复制失败:内部错误:传输消息中的HTTP标头信息已损坏或丢失 - SQL Server CE replication failure: Internal error: HTTP header information is either corrupted or missing in the transport message 服务器端的HTTP标头 - HTTP Header on server side HTTP 请求标头自定义值不会发送到服务器 C# - HTTP request header custom value not going to server C# HTTP GET服务器-错误的标题 - HTTP GET Server - Incorrect Header 安全标头无效错误消息 - Security header is not valid error message
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM