简体   繁体   English

服务器无法识别HTTP标头SOAPAction启动的值

[英]Server did not recognize the value of HTTP Header SOAPAction initiate

i have a simple web method. 我有一个简单的网络方法。 when i call it i get the below error. 当我调用它时,出现以下错误。

Server did not recognize the value of HTTP Header SOAPAction initiate. 服务器无法识别HTTP标头SOAPAction启动的值。

we call the webmethod from java client and we add the below code to the header. 我们从Java客户端调用webmethod,然后将以下代码添加到标头中。

addRequestHeader("SOAPAction", "initiate"); 

how to add it to the header in the server code (C#)? 如何将其添加到服务器代码(C#)的标头中?

I've decided to post my own answer here because I've lost a few hours on this and I think that, although the accepted answer of this other question (http://stackoverflow.com/questions/352174/server-did-not-recognize-the-value-of-http-header-soapaction/14084341#14084341) is very good and pointed me in the right direction (yes, it got a voteup), it was not detailed enough to explain what was wrong with my application, at least in my case. 我已经决定在这里发布自己的答案,因为我已经在此问题上浪费了几个小时,我认为,尽管这个问题的答案已经被接受(http://stackoverflow.com/questions/352174/server-did- not-receognize-the-value-of-http-header-soapaction / 14084341#14084341)非常好,并向我指出了正确的方向(是的,它得到了表决),它不够详细,无法解释出什么问题了我的申请,至少就我而言。

I'm running a BPEL module in OpenESB 2.2 and the Test Case of my Composite Application was failing with the following error: 我在OpenESB 2.2中运行BPEL模块,并且我的Composite Application的测试用例由于以下错误而失败:

Caused by: System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: .

After doing some research I've noticed that the external WSDL has all the clues we need to fix this problem, eg, I'm using the following web service to validate a credit card number through a orchestration of Web Services: http://www.webservicex.net/CreditCard.asmx?WSDL 在进行了一些研究之后,我注意到外部WSDL具有解决此问题所需的所有线索,例如,我正在使用以下Web服务通过Web服务的编排来验证信用卡号: http:// www.webservicex.net/CreditCard.asmx?WSDL

If you check the 如果您检查

<wsdl:binding name="CCCheckerSoap" type="tns:CCCheckerSoap">
  <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
  <wsdl:operation name="ValidateCardNumber">
    <soap:operation soapAction="http://www.webservicex.net/ValidateCardNumber" style="document"/>
    <wsdl:input>
  <soap:body use="literal"/>
</wsdl:input>
...

But, once you create the Composite Application and build the project with the BPEL that invokes this external WSDL service, for some reason (bug?), the XML of the Composite Application Service Assembly (CASA) binding is generated with an empty soapAction parameter: 但是,一旦创建了复合应用程序并使用调用此外部WSDL服务的BPEL构建项目,由于某种原因(错误?),将使用空的soapAction参数生成复合应用程序服务程序集(CASA)绑定的XML:

<binding name="casaBinding1" type="ns:CCCheckerSoap">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="ValidateCardNumber">
            <soap:operation soapAction="" style="document"/>
            <input>
                <soap:body use="literal"/>
            </input>

Once you copy the proper soapAction (http://www.webservicex.net/ValidateCardNumber) into this parameter, the application's Test Case will correctly and return the expected Soap response. 将正确的soapAction(http://www.webservicex.net/ValidateCardNumber)复制到此参数后,应用程序的“测试用例”将正确并返回预期的Soap响应。

<soap:operation soapAction="http://www.webservicex.net/ValidateCardNumber" style="document"/>

So, it's a more specific solution that I decided to document based on the information found in this blog post: http://bluebones.net/2003/07/server-did-not-recognize-http-header-soapaction/ . 因此,我决定根据此博客文章中的信息来记录更具体的解决方案: http : //bluebones.net/2003/07/server-did-not-recognize-http-header-soapaction/

It means (at least in my case) that you are accessing a web service with SOAP and passing a SOAPAction parameter in the HTTP request that does not match what the service is expecting. 这意味着(至少就我而言),这意味着您正在使用SOAP访问Web服务并在HTTP请求中传递与该服务期望不匹配的SOAPAction参数。

声明:本站的技术帖子网页,遵循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 Message =服务器无法识别HTTP标头SOAPAction的值:错误 - Message=Server did not recognize the value of HTTP Header SOAPAction: error 通过编程方式定义绑定而不是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: 发起标头一次并在每个 HTTP 请求中发送 - Initiate Header Once and Send in Every HTTP Request 服务器端的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 .NET Core 与 .NET Framework 中基于 HTTP 的 SOAPAction - SOAPAction over HTTP in .NET Core vs .NET Framework
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM