I'm a newb to WCF bindings and would appreciate any help making a custom binding that:
- Supports Binary Message encoding.
- Uses Transport Security (clientCredentialType="None").
Thanks for any help.
I'm a newb to WCF bindings and would appreciate any help making a custom binding that:
Thanks for any help.
You need to create a custom binding in your <system.serviceModel>
section of the config - something like this:
<bindings>
<customBinding>
<binding name="HttpBinaryBinding">
<binaryMessageEncoding />
<httpTransport />
</binding>
</customBinding>
</bindings>
There's a ton of features and options you can define here - the sequence of the elements is important - message encoding before transport, and transport is the last of the options in the stack. See the MSDN Docs on Custom Bindings or Kirk Evans' blog post for more details on all available options and rules how to combine them.
Once you've defined your custom binding, you can use it by specifying binding="customBinding"
and then bindingConfiguration="HttpBinaryBinding"
on your endpoints - both on the server side as well as on the client side.
<endpoint
address="http://localhost:8001/myService/"
binding="customBinding"
bindingConfiguration="HttpBinaryBinding"
contract="IMyService"
name="customHttpBindingEndpoint" />
That's really all there is!