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 https://computername.company.region.local/VirtualDirectory/ServiceName.svc 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.]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?
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
\\FileshareName\Directories\...\Default.aspx.vb:12System.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
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.
- Proposed as answer by Amit Sharma [MSFT]Microsoft employee, Moderator Friday, May 15, 2009 4:15 AM
I fixed this error.
On the server I had:
<system.serviceModel> <bindings> <wsHttpBinding> <binding name="IstMembershipBinding"> <security mode="Message"> <message clientCredentialType="UserName" /> </security> </binding> </wsHttpBinding> </bindings>but I needed to change the <security mode> to TransportWithMessageCredential.
- Proposed as answer by sumitgup Friday, January 21, 2011 11:14 AM