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


  • Hello all,

    We have recently begun implementing a WCF Service to provide some marketing functionality for a client and are getting the message "The remote server returned an error: (404) Not Found." when trying to test it on a development machine. The environment is Vista with SP1 and Visual Studio 2008 FX 3.5 SP1. The service is hosted in a virtual directory in IIS7 and is being called from a Web Application project hosted in Cassini (ASP.NET dev server). The service and the consumer web app are being built and debugged in the same Visual Studio solution.

    The webservice uses basicHttpBinding with TransportWithMessageCredential where the transport uses SSL and message uses UserName. We have implemented a test SSL using the steps outlined here (although we also had to make use pf the Private Key Import tool 'pvkimprt' to create an exchange file for IIS7).

    The service is accessed on and when that is typed into IE or Firefox we can access the servuce just fine. It is only when the service is called from the consuming application that we get the 404 error. The stack trace is as follows:

    [WebException: The remote server returned an error: (404) Not Found.]
    System.Net.HttpWebRequest.GetResponse() +5314029
    System.ServiceModel.Channels.HttpChannelRequest.WaitForReply(TimeSpan timeout) +54

    [EndpointNotFoundException: There was no endpoint listening at https://xxxx.xxxx.xxxx.local/VirtualDirectory/ServiceName.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.]
    System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +7596735
    System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +275
    CyProMarketing.CyProWebService.ICyProWebService.GetUnsubscribeRequests(DateTime lastRequest) +0
    CyProMarketing.CyProWebService.CyProWebServiceClient.GetUnsubscribeRequests(DateTime lastRequest) in \\FileshareName\Directories\...\Reference.vb:64
    CyProMarketing._Default.Button1_Click(Object sender, EventArgs e) in
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
    I have searched the internet high and low and cannot find any answers to this. Any ideas as to what could be going wrong here?


    Thursday, March 12, 2009 10:42 AM

All replies

  • Gonna bump this as I am completely stuck on this issue and it is preventing me from progressing this application

    Monday, March 16, 2009 9:52 AM
  • Same issue here... from the exception to the search to find a solution.  Have you figured this out yet?
    Tuesday, May 5, 2009 3:46 PM
  • can you try to host your test web application project in IIS, instead of using Cassini, and see if you can repro this issue.  Please post back if that worked for you.

    Tuesday, May 5, 2009 9:28 PM
  • Will do.
    Wednesday, May 6, 2009 2:52 PM
  • I am having the same issue here.

    Did you have any luck?

    Thursday, May 27, 2010 12:25 PM
  • I fixed this error.

    On the server I had:

        <binding name="IstMembershipBinding">
         <security mode="Message">
          <message clientCredentialType="UserName" />     
    but I needed to change the <security mode> to TransportWithMessageCredential.
    • Proposed as answer by sumitgup Friday, January 21, 2011 11:14 AM
    Thursday, May 27, 2010 1:05 PM