Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I got an error turkish so I don't write original text but english probably like below error

BasicHttpBinding_ITeklifService
and
ServiceTeklif.ITeklifService


What's wrong I don't understand




"System.InvalidOperationException : Could not find default endpoint element that references contract ‘ServiceTeklif.ITeklifService’ 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 contract could be found in the client element. "


My Coonnection at code
C#
MainForm.epTeklif = new EndpointAddress("http://xxx.net/TeklifService.svc");
TeklifServiceClient CookieAlClient = new TeklifServiceClient("BasicHttpBinding_ITeklifService1", MainForm.epTeklif);


My App.config

<configuration>
    <configSections>
        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
            <section name="crm2cTarayici.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
        </sectionGroup>
    </configSections>
    <userSettings>
        <crm2cTarayici.Properties.Settings>
            <setting name="ShowScriptErrors" serializeAs="String">
                <value>False</value>
            </setting>
            <setting name="FilterLevel" serializeAs="String">
                <value>Low</value>
            </setting>
        </crm2cTarayici.Properties.Settings>
    </userSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_ITeklifService"/>
                <binding name="BasicHttpBinding_ITeklifService1"/>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:6550/TeklifService.svc" binding="basicHttpBinding"
                bindingConfiguration="BasicHttpBinding_ITeklifService" contract="ServiceTeklif.ITeklifService"
                name="BasicHttpBinding_ITeklifService" />
            <endpoint address="http://xxx.net/TeklifService.svc" binding="basicHttpBinding"
                bindingConfiguration="BasicHttpBinding_ITeklifService1" contract="ServiceReference1.ITeklifService"
                name="BasicHttpBinding_ITeklifService1" />
        </client>
      
    </system.serviceModel>
</configuration>
Posted

1 solution

Try to change the contract attribute of your second endpoint element to ServiceTeklif.ITeklifService.

 
Share this answer
 
v2
Comments
amagitech 23-Jul-15 7:59am    
it's not worked
Shmuel Zang 23-Jul-15 9:24am    
So, It's realy looks strange. But, it's little difficult to see the problem without seeing the entire details.
What is TeklifServiceClient? Is that a class that was generated using "Add Service Reference"? Are there other uses of your service in your code?
amagitech 23-Jul-15 10:00am    
I added service reference it generated by pc

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900