Problem: WCF – The remote server returned an error: (404) Not Found.

Problem: WCF – The remote server returned an error: (404) Not Found.

Hi There,

I’m trying to connect to a service that resides on a remote machine. I have added the service reference and then edited the configuration file using the WCF config editor. I keep getting the following error: {“There was no endpoint listening at http://myip/myservice.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.”} The inner exception is :The remote server returned an error: (404) Not Found.

I have verfied that the service works, shows metadata etc as i’m calling it from some AJAX methods on the same machine as the service resides.

code that i'm using to call the service
 
 
 using (Service.ServiceClient serv = new ServiceClient())
                {
 
                 
                        bool result = serv.mywebservicemethod();
}
 
config file from the website i'm trying to call from

Solution: WCF – The remote server returned an error: (404) Not Found.

http://myip/myservice.svc” behaviorConfiguration=”Myservice.Behavior”
binding=”webHttpBinding” name=”myendpoint” contract=”Service.IService” />

In this I could see, the end point binding you have given as “webHttpBinding”, instead we have “wsHttpBinding” or “basicHttpBinding”.

Use “basicHttpBinding”. We don not have any binding “webHttpBinding” at all.