Could not find endpoint element with name 'System.ServiceModel.BasicHttpBinding' and contract 'X' RRS feed

  • Question

  • I have added a remote service reference from WSDL :   & this has added several,classes and partials to my project  including 

     FrameworkiSearchPersonPortTypeClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
                    base(binding, remoteAddress) {

    I assume this is the customClient class, as its the only one that takes a binding &  endpoint 

    In My app code, 

    string url = "";
    EndpointAddress epoint = new EndpointAddress(url);
    BasicHttpBinding binding = new BasicHttpBinding();
     myAPI.FrameworkiSearchPersonPortTypeClient client = new  myAPI.FrameworkiSearchPersonPortTypeClient(binding.ToString(), url);

    triggers the error :

    "Could not find endpoint element with name 'System.ServiceModel.BasicHttpBinding' and contract myAPI.FrameworkiSearchPersonPortType' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.  "

    The web config contains the following system.serviceModel 

            <binding name="FrameworkiSearchPersonSoapBinding">
              <security mode="Transport" />
            <binding name="FrameworkiSearchPersonSoapBinding1" />
          <endpoint address=""
            binding="basicHttpBinding" bindingConfiguration="FrameworkiSearchPersonSoapBinding"
            contract="myAPI.FrameworkiSearchPersonPortType" name="FrameworkiSearchPerson" />

    I have tried a few tweaks so far, with no success : 

    Change the bindings to be BasicHttpsBinding  or WSHttpBinding 
    Change the contract to be include the namespace

    Can anyone help? 

    Thanks in advance


    Thursday, November 26, 2015 1:18 PM


All replies