wsHttpBinding配置

发布于 2024-11-19 06:18:15 字数 568 浏览 1 评论 0原文

我正在读一本 wcf 书,遇到以下代码块,

<bindings>
  <wsHttpBinding>
    <binding name="ProductsServiceWSHttpBindingConfig">
      <security mode="TransportWithMessageCredential">
        <transport clientCredentialType="None" />
        <message clientCredentialType="UserName" />
      </security>
    </binding>
  </wsHttpBinding>
</bindings>

我对 感到困惑> 我进行了在线搜索并得出了每个的含义。但是,不确定该代码块的结果是什么。提前致谢。

I was reading a wcf book and come accross the following code block

<bindings>
  <wsHttpBinding>
    <binding name="ProductsServiceWSHttpBindingConfig">
      <security mode="TransportWithMessageCredential">
        <transport clientCredentialType="None" />
        <message clientCredentialType="UserName" />
      </security>
    </binding>
  </wsHttpBinding>
</bindings>

I'm confused with the <transport ....> and <message ...>
I did onlne search and was able to conclude meaning of each. But, not sure what will be the outcome of this code block. Thanks in advance.

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

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

发布评论

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

评论(1

墨落画卷 2024-11-26 06:18:15

当您要为 WsHttpBinding 配置安全性时,您首先必须选择如何保护通信的安全。这是由安全元素中的mode配置的:

  • None - 无安全和身份验证
  • Transport - 通信将在以下时间加密传输级别 (HTTPS) 和身份验证也将在传输级别完成(通过 HTTP 标头)
  • TransportWithMessageCredential - 通信将在传输级别 (HTTPS) 上加密,身份验证将在消息级别完成(通过标准化) SOAP 标头)
  • 消息 - 每条消息都将按照 WS-Security 标准单独加密和签名,并通过 HTTP 发送,并且身份验证也将在消息级别完成。加密、签名和身份验证使用标准化 SOAP 标头。

定义 mode 后,您可以使用 transportmessage 元素进一步指定特定 mode 中使用的安全性详细信息。最常见的设置是 clientCredentialType,它指定服务如何对客户端进行身份验证。 transport 元素提供 HTTP 协议中可用的模式,message 元素提供 WS-Security 指定的模式。

您的配置使用 HTTPS 和 SOAP 标头(用户名令牌)定义端点绑定,以将用户名和密码传递给服务。

When you are going to configure security for WsHttpBinding you first have to choose how the communication will be secured. That is configured by mode in security element:

  • None - no security and authentication
  • Transport - communication will be encrypted on transport level (HTTPS) and authentication will be done on transport level as well (through HTTP headers)
  • TransportWithMessageCredential - communication will be encrypted on transport level (HTTPS) and authentication will be done on message level (trough standardized SOAP headers)
  • Message - each message will be separately encrypted and signed following WS-Security standards and send over HTTP and authentication will be done on message level as well. Encryption, signing and authentication use standardized SOAP headers.

Once you defined mode you can use transport and message elements to further specify details of security used in specific mode. The most common setting is clientCredentialType which specifies how is client authenticated by the service. transport element offers modes available in HTTP protocol and message element offers modes specified by WS-Security.

Your configuration defines binding for endpoint using HTTPS and SOAP header (UserName Token) for passing user name and password to the service.

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