WCF HTTPS Service Configuration with CustomBinding

I needed to configure the WCF service binding so that I could pass the raw content to the WCFRest service. Works great, but I can't get it to accept transport-level security. I want https and basicauthentication, as I use elsewhere. The end point is as follows:

<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 the system complains that the mode attribute is not allowed in node security. Without node security, everything works fine, but not https.

thanks

Ray

+4
source share
1 answer

It seems to me that 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> 

You might need the following link: http://msdn.microsoft.com/en-us/library/ms731818.aspx

+6
source

All Articles