Friday, July 2, 2010

Unable to host WCF Service in remote machine and Use it

You see WCF service works fine  if you use it in the application which resides in the same machine as that of
WCF service.But if you try to host the WCF service in remote machine and use it from your application,you can not add service reference even though you have given correct reference url..

Change Binding to basicHttpBinding from WsHttpBinding. of your WCF Service and rebuild.
Then add a reference to the service which is hosted in your local machine--say http:\\youripaddress\MyService\Service1.svc to the application.
Change the endpoint address

 < endpoint address="http://192.168.160.58/MyService/Service1.svc"              
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IDALService"
                contract="CRSService.IDALService" name="BasicHttpBinding_IDALService" />

This solves your problem.

No comments: