I have build a test WCF Service Service1.svc I have added service reference of the service to my Winform. Its working good and i can easily consume the WCF service in winform. But i got a major problem :
- When i rename or delete the 'MyProject.exe.config' file. It is showing error ' Could not find endpoint element with name BasicHttpBinding_IService1 and contract ServiceReferenct1.IService1
Since 'MyProject.exe.config' file contains binding and endpoint address which i don't want to share with client or anyone.
Is there any way to dynamically set endpoint element and contract without using 'MyProject.exe.config' file ?
App.config :
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client" />
</startup>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService1" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://svc.phed.net/Service1.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IService1" contract="ServiceReference1.IService1"
name="BasicHttpBinding_IService1" />
</client>
</system.serviceModel>
</configuration>
- How can i change the Default Message shown by service:
You have created a service. To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax: