【问题标题】:WCF Service configuration HTTPS with CustomBinding带有 CustomBinding 的 WCF 服务配置 HTTPS
【发布时间】:2013-10-14 11:24:37
【问题描述】:

我需要对 WCF 服务进行自定义绑定,以允许我将原始内容传递给 WCFRest 服务。效果很好,但我无法让它接受传输级别的安全性。我想要 https 和 basicauthentication,就像我在其他地方使用的一样。端点如下所示:

   <endpoint address="" behaviorConfiguration="web" contract="SmsService.ISmsReceive" binding="customBinding" bindingConfiguration="RawReceiveCapable"></endpoint>

customBinding 如下所示:

  <customBinding>
    <binding name="RawReceiveCapable">
      <security mode="Transport">
        <transport clientCredentialType="Basic"/>
      </security>
      <webMessageEncoding webContentTypeMapperType="SmsService.RawContentTypeMapper, SmsService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
      <httpTransport manualAddressing="true" maxReceivedMessageSize="524288000" transferMode="Streamed" />
    </binding>
  </customBinding>

但系统抱怨安全节点中不允许使用模式属性。没有安全节点,一切都很好,但它不是 https。

谢谢

【问题讨论】:

    标签: wcf https wcf-binding basic-authentication transport


    【解决方案1】:

    我认为您需要删除 &lt;security&gt; 元素,然后将 httpTransport 元素更改为 httpsTransport,如下例所示:

    <system.serviceModel>
        <bindings>
            <customBinding>
                <binding name="RawReceiveCapable">
                  <webMessageEncoding webContentTypeMapperType="SmsService.RawContentTypeMapper, SmsService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
                  <httpsTransport authenticationScheme="Basic"  manualAddressing="true" maxReceivedMessageSize="524288000" transferMode="Streamed" />
                </binding>
            </customBinding>
        </bindings>
    

    以下链接可能会有所帮助: http://msdn.microsoft.com/en-us/library/ms731818.aspx

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-17
      • 2013-10-24
      • 1970-01-01
      • 2020-01-09
      • 1970-01-01
      • 1970-01-01
      • 2022-01-16
      • 1970-01-01
      相关资源
      最近更新 更多