Rafał Developer
Rafał Developer

Reputation: 2055

Could not find endpoint element with name WCF

I send name to endpoint but I get error.

Error:

Could not find endpoint element with name 'HTTP_Port' and contract 'WSPI.InvoiceCheck_Out' 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.

enter image description here

WebConfig:

<client>
            <endpoint address="https://example.company.eu:51201"
                binding="basicHttpBinding" bindingConfiguration="InvoiceCheck_OutBinding"
                contract="WSPI.InvoiceCheck_Out" name="HTTP_Port" />
            <endpoint address="https://example.company.eu:51201"
                binding="basicHttpBinding" bindingConfiguration="InvoiceCheck_OutBinding1"
                contract="WSPI.InvoiceCheck_Out" name="HTTPS_Port" />
</client>

I put this here work correct App.config:

<?xml version="1.0"?>
<configuration>
  <startup>
    <supportedRuntime version="v2.0.50727"/>
  </startup>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.SharePoint" publicKeyToken="71E9BCE111E9429C" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>

  </runtime>
    <system.serviceModel>
      <bindings>
        <basicHttpBinding>
          <binding name="InvoiceCheck_OutBinding" />
          <binding name="InvoiceCheck_OutBinding1">
            <security mode="Transport" />
          </binding>
        </basicHttpBinding>
      </bindings>
      <client>
        <endpoint address="http://test"
            binding="basicHttpBinding" bindingConfiguration="InvoiceCheck_OutBinding"
            contract="WSPI.InvoiceCheck_Out" name="HTTP_Port" />
        <endpoint address="https://test"
            binding="basicHttpBinding" bindingConfiguration="InvoiceCheck_OutBinding1"
            contract="WSPI.InvoiceCheck_Out" name="HTTPS_Port" />
      </client>
    </system.serviceModel>
</configuration>

Upvotes: 4

Views: 4258

Answers (1)

JKennedy
JKennedy

Reputation: 18827

Because you are referencing this code as a dll your code is going to be checking your application (in your case your console app) that is referencing it for the configuration. Try taking your <System.ServiceModel> configuration from your dll and adding it to the app.config for your console application that should work.

Upvotes: 5

Related Questions