WCF 基本http绑定 400 错误

发布于 2024-10-10 01:35:59 字数 1373 浏览 0 评论 0原文

我正在使用 Fiddler 向我的网络服务发布肥皂请求。我在使用控制台应用程序客户端(带有服务引用代理)时捕获了来自服务的请求。通过服务引用客户端的请求工作正常。但是,当我在 fiddler 中使用相同的请求数据时,我收到 400 bad request 错误。我在 fiddler 中使用的请求数据如下。任何指导都会很棒!

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://localhost:51909/Service1.svc</To>
    <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/IService1/Test</Action>
  </s:Header>
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Test xmlns="http://tempuri.org/">
      <request>
        <Data xmlns="http://www.hr-xml.org/3">
          <Position>
            <DocID>1234556677</DocID>
          </Position>
        </Data>
      </request>
    </Test>
  </s:Body>
</s:Envelope>

在 fiddler 中使用以下内容标头

Content-Length: 786 内容类型:text/xml SoapAction: http://tempuri.org/Service1/Test

编辑:我发现了确切的错误,但我'我不确定这是什么意思。错误是寻址版本“AddressingNone (http://schemas.microsoft.com/ws/2005/05/addressing/none)”不支持添加 WS-Addressing 标头。有什么想法吗?

I'm using Fiddler to post a soap request to my web service. I've captured the request from the service when using a console app client (with service reference proxy). The request via the service reference client works fine. However when I use the same request data in fiddler I get a 400 bad request error. The request data i'm using in fiddler is below. Any guidance would be great!

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://localhost:51909/Service1.svc</To>
    <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/IService1/Test</Action>
  </s:Header>
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Test xmlns="http://tempuri.org/">
      <request>
        <Data xmlns="http://www.hr-xml.org/3">
          <Position>
            <DocID>1234556677</DocID>
          </Position>
        </Data>
      </request>
    </Test>
  </s:Body>
</s:Envelope>

using the following content headers in fiddler

Content-Length: 786
Content-type: text/xml
SoapAction: http://tempuri.org/Service1/Test

EDIT: I found the exact error but i'm not sure what it means. The error is Addressing Version 'AddressingNone (http://schemas.microsoft.com/ws/2005/05/addressing/none)' does not support adding WS-Addressing headers. Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空心空情空意 2024-10-17 01:35:59

您的服务上的 MessageVersion 似乎未设置为接受 WS-Addressing。您必须删除 Soap 标头“To”和“Action”,或者设置您的 MessageVersion 以允许 WS-Addressing。

http://msdn.microsoft.com/en-us /library/system.servicemodel.channels.messageversion.aspx

如果这没有帮助,请发布您的服务配置。

It looks like your MessageVersion on your Service is not set to accept WS-Addressing. You will have to remove the Soap Header "To" and "Action" or set your MessageVersion to allow for WS-Addressing.

http://msdn.microsoft.com/en-us/library/system.servicemodel.channels.messageversion.aspx

If this does not help please post your service configuration.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文