WCF Service configuration HTTPS with CustomBinding
Asked Answered
C

1

8

I needed a custombinding on a WCF Service to allow me to pass raw content to WCFRest service. Works great, but I can't get it to accept transport level security. I want https and basicauthentication as I use elsewhere. Endpoint looks like this:

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

customBinding looks like this:

  <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>

but system complains that mode attribute is not allowed in the security node. Without the security node all works great but it's not https.

Thanks

Ray

Cirri answered 7/10, 2013 at 18:56 Comment(0)
L
13

I think you need to drop the <security> element and then change the httpTransport element to httpsTransport as shown in the following example:

<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>

The following link might be helpful: http://msdn.microsoft.com/en-us/library/ms731818.aspx

Linden answered 7/10, 2013 at 21:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.