Search code examples
wcfweb-servicesservice-reference

Could not find endpoint element


The errror message is:

Could not find endpoint element with name 'NetbiterServiceReference.nbws' and contract 'NetbiterServiceReference.nbws' in the ServiceModel client configuration section.

My app.config file looks like this:

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="nbws.cfcSoapBinding">
                <security mode="Transport" />
            </binding>
            <binding name="nbws.cfcSoapBinding1" />
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="https://../nbws.cfc"
            binding="basicHttpBinding" bindingConfiguration="nbws.cfcSoapBinding"
            contract="NetbiterServiceReference.nbws" name="nbws.cfc" />
    </client>
</system.serviceModel>

In my code I do like this and i gives the error message above.

 nbwsClient proxy = new nbwsClient();

Then I did all these combinations, but with the same result:

nbwsClient proxy = new nbwsClient("NetbiterServiceReference.nbws", "https://../nbws.cfc");
nbwsClient proxy = new nbwsClient("nbws", "https://../nbws.cfc");
nbwsClient proxy = new nbwsClient("nbws.cfc", "https://../nbws.cfc");

Any ideas would be appreciated!


Solution

  • Resolved it myself. Problem was that the test-project, running the project with code and app.config didn’t have the correct information in the app.config.