gpt4 book ai didi

c# - BasicHttpBinding 和 MessageVersion.None

转载 作者:行者123 更新时间:2023-11-30 22:45:56 28 4
gpt4 key购买 nike

如何配置 XML Web 服务客户端以将 MessageVersion.Soap11WSAddressing10 用于 header 命名空间。目前它使用 MessageVersion.None 命名空间,我无法更改它。

最佳答案

您需要使用自定义 WCF 绑定(bind)来执行此操作:

  <system.serviceModel>
<bindings>
<customBinding>
<binding name="Soap11Addr10">
<textMessageEncoding messageVersion="Soap11WSAddressing10" />
<httpTransport/>
</binding>
</customBinding>
</bindings>

然后在您的服务端点中引用该自定义绑定(bind)(按名称):

    <services>
<service name="YourAssembly.YourService">
<endpoint name="test"
address=""
binding="customBinding"
bindingConfiguration="Soap11Addr10"
contract="YourAssembly.IYourService" />
</service>
</services>
</system.serviceModel>

如果你想从客户端使用它,你还需要将自定义绑定(bind)配置复制到客户端的 app.configweb.config 并在那里引用它,当然(在 Visual Studio 中使用 Add Service Reference 会为您做这件事)。

关于c# - BasicHttpBinding 和 MessageVersion.None,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2847645/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com