0

In Visual Studio, SOAP WCF, configuration parameters are way too strict.

If you set in Web config the name of the endpoint

  <service name="...">
  <endpoint name="**specific**" bindingName="whatever" contract="some IService" 
   bindingConfiguration="configuration Name" 
              binding="basicHttpBinding" bindingNamespace="some space"/>

the name of endpoint will override all names: endpoint name, endpoint binding configuration and binding name in output.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
               <binding name="**specific**">
                  ...
               </binding>
           </basicHttpBinding>
       </bindings>
        <client>
          <endpoint address="address"
            binding="basicHttpBinding" bindingConfiguration="**specific**"
            contract="some IService" name="**specific**" />
    </client>
   </system.serviceModel>
</configuration>

There is no way to have these two names, binding configuration and endpoint, set the way I want. If I set, for example, bindingName in endpoint, it will use it to create bindingName_ServiceName in all three places, again I cannot set these two, endpoint name and binding configuration name, the way I want.

If I take any service out there using svcutil, these names are usually different.

Is there a way to control them from Visual Studio? (Even if done from code it has the same effect.)

I need this since my configuration file must be the same as the one I have.

1 Answers1

0

The issue is resolved in a little bit more complicated and convoluted way than what you would like to have looking into the simplicity of the question.

First part, to name the binding in output.config you need to use name attribute of endpoint in web.config.

Second part, to give the name of endpoint in output.config you need to override port naming as explained in

WSDL-first approach: How to specify different names for wsdl:port and wsdl:binding?

Why is there a total confusion over what endpoint and binding attributes mean in output.config and web.config? You tell me.

Community
  • 1
  • 1