So I am working with configuring endpoints for a WCF service. I have almost no experience with services as a whole, but have been plopped in the middle of a project that uses them. I roughly understand what each attribute in the endpoint is doing except for one. "bindingConfiguration".
Here's an obscured version of my code (actual information is proprietary):
<endpoint address="http://localhost/SomeService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ISomeService"
contract="SomeService.ICoreService" name="BasicHttpBinding_ISomeService" />
Here's MSDN's take on it (as in they don't specifically address it).
Microsoft's incomplete MSDN Entry
Of course Stackoverflow has a few questions containing a string match for "bindingConfiguration" but none explicetely address my question:
Most relative (I think) Stackoverflow question
Any ideas on what this is used for?
In the interest of learning I am willing to take a stab and be wrong here. I think it has something to with authentication or security. On Inspection of the Interface I notice nothing pertaining to this either.
Any help would be great!
Cheers
Matt
Bindings are objects that are used to specify the communication details that are required to connect to the endpoint of a Windows Communication Foundation (WCF) service. Each endpoint in a WCF service requires a binding to be well-specified.
NET Framework. Defines a binding that a WCF service can use to configure and expose endpoints to communicate with services conforming to the WS-I Basic Profile 1.1.
In your bindings section, you can have multiple "configurations" for the same binding type (in your case, basicHttpBinding). The binding configuration chooses among them which one to use.
In MSDN, you should try to find the reference for <endpoint>
(since bindingConfiguration is is attribute), that will have a definition of what the attribute is supposed to do.
In the example below, the service defines two endpoints, both using basicHttpBinding
. One of them is exposed over "normal" HTTP, the other is exposed over HTTPS. The bindingconfiguration
attribute is the one which tells WCF which configuration to use.
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="SimpleBasic">
<security mode="None"/>
</binding>
<binding name="BasicOverHttps">
<security mode="Transport"/>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="MyNamespace.MyService">
<endpoint address="ep"
binding="basicHttpBinding"
bindingConfiguration="SimpleBasic"
contract="MyNamespace.IService" />
<endpoint address="secure"
binding="basicHttpBinding"
bindingConfiguration="BasicOverHttps"
contract="MyNamespace.IService" />
</service>
</services>
</system.serviceModel>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With