views:

24

answers:

1

I am trying to get a WCF webservice running which will participate in distributed transactions. I keep getting the following error message...

Configuration binding extension 'system.serviceModel/bindings/myBinding' could not be found. Verify that this binding extension is properly registered in system.serviceModel/extensions/bindingExtensions and that it is spelled correctly

Here is the web.config

  <system.serviceModel>
<services>
  <service name = "DistServiceX">
    <endpoint
       address=""
       binding="myBinding"
       contract="IDistService"
     />
  </service>
</services>
<bindings>
  <wsHttpBinding>
    <binding
      name="myBinding" 
      transactionFlow="true"
      />
  </wsHttpBinding>
</bindings>

<behaviors>
  <serviceBehaviors>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

Can anyone see what is wrong with this? It's driving me crazy!

Thanks

Pete

A: 

You are referring to a custom binding here:

<service name = "DistServiceX">
   <endpoint
       address=""
       binding="myBinding"
      contract="IDistService" />

However, there is no custom binding called myBinding anywhere in your config.

I assume you really want to refer to a wsHttpBinding and the myBinding binding configuration that you specified in your config file. Furthermore: the name of the service must match the fully qualified name of the class that implements the service - including namespace (and also: the name of the contract being implemented by that service and exposed on a given endpoint must include any namespaces):

<service name="YourNamespace.DistServiceX">
   <endpoint
       address=""
       binding="wsHttpBinding" 
       bindingConfiguration="myBinding"
       contract="YourNamespace.IDistService" />
marc_s
You are correct. In addition though I also had to fully quality the IDistService interface with a namespace and also specify the namespace.class of the implementing class instead of "DistServiceX"
Peter Morris
Hi Marc. Can you include that in your response? Once the response is complete I can accept it as an answer. It'll just be more helpful for others in future if all of the problems with the config are mentioned in the accepted answer.
Peter Morris
@Peter Morris: good point - answer is updated.
marc_s