getting Error : The remote server returned an error: NotFound. after hosting WCF


  • I have hosted silverlight WCF in the IIS 6.0 . Then i have added the service reference to my silverlight project now  i m able to get the method exposed by WCF. But problem appears at runtime when the WCF was called asynchronusly it throws an error of  " The remote server returned an error: NotFound." on EndResult Method  of channel class. I m not able to fiogure out why i m getting this error because when i m using the same WCF service project in the same solution of silverlight project then error never occurs. How to get rid of this error.


    Tuesday, October 20, 2009 4:22 AM

All replies

  • Hi,

    I hope you are already using clientaccesspolicy.xml file at the root directory C:\Inetput\WWWRoot. Try using IP address instead of localhost.

    Also try to browse the service from IIS and re-add the reference.

    Check the below thread for more information-



    "Please mark as answered, if this answers your question"

    Tuesday, October 20, 2009 4:32 AM
  • Thanks Pravin  but the issue is that i have already tried the things u have suggest . But No sucess so far. i m geeting the service reference but getting error on EndResult Method on runtime.

    Tuesday, October 20, 2009 5:08 AM
  • It is possible your service is throwing an exception, before returning to your Silverlight app. I would suggest using Fiddler to see the messages being sent between your service and your application. With Fiddler, make sure you don't use localhost as it will not intercept any messages coming from localhost (a limitation of WinINET, not Fiddler). Also, I would suggest enabling tracing on your service, and using the WCF Service Trace Viewer, so you can see what is going on in your service, or at least step through your service using the Visual Studio debugger. Thanks, Ron Kanagy
    Tuesday, October 20, 2009 7:23 AM
  • I have checked  the same in debugging mode the Wcf never shows any error while application is loading, it throws the error while eatablishing connection to get the result asyn. The strange thing  is that, it is not giving any error while i m creating proxy at silverlight end at runtime and throws the error while i m calling asyn thru that proxy. this things happen only if i services that is hosted on IIS and not throwing any error while the same WCF Service Reference is taken from the same project.

    Tuesday, October 20, 2009 7:56 AM
  • Try using Fiddler to see what kind of messages are being sent between the app and the service, and also what kind of HTTP error codes, if any, are being returned. In Fiddler, you can get additional information by looking at the request and response messages being sent between the app and the service. Also, look if there are any issues with trying to find the clientaccesspolicy.xml file. It's possible it could be a permissions issue. Thanks, Ron Kanagy
    Tuesday, October 20, 2009 8:14 AM
  • Hi,

    Which Binding are you using for WCF Service? Check the link below.



    "Please mark as answered, if this answers your question"

    Tuesday, October 20, 2009 8:34 AM
  • Can you please post your client config file?

    Tuesday, October 20, 2009 9:13 AM
  • Hi,

    Not Found is a general exception that can be caused by certain reasons, you could try enable IncludeExceptionDetailInFaults to get detail exception message.

         <behavior name="WCF_silverlight.Web.Service1Behavior">
         <serviceMetadata httpGetEnabled="true" />
         <serviceDebug includeExceptionDetailInFaults="true" />


    Wednesday, October 21, 2009 11:44 PM
  • Tried Same But no sucess so far

    Thursday, October 22, 2009 12:12 AM

    Service Config : 




    <service name="WcfService2.Service1" behaviorConfiguration="WcfService2.Service1Behavior">

    <!-- Service Endpoints -->

    <endpoint address="" binding="wsHttpBinding" contract="WcfService2.IService1"><!--

    Upon deployment, the following identity element should be removed or replaced to reflect the

    identity under which the deployed service runs. If removed, WCF will infer an appropriate identity




    <dns value="localhost"/>



    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>





    <behavior name="WcfService2.Service1Behavior">

    <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->

    <serviceMetadata httpGetEnabled="true"/>

    <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->

    <serviceDebug includeExceptionDetailInFaults="true"/>








    Client Config :






    <binding name="MyService" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">

    <security mode="None" />




    <binding name="CustomBinding_MyWCFService">

    <binaryMessageEncoding />

    <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />


    <binding name="CustomBinding_MyWCFService1">

    <binaryMessageEncoding />

    <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />





    <endpoint address=""

    binding="basicHttpBinding" bindingConfiguration="MyService"

    contract="LocalHostDalService.IDALService" name="MyService" />

    <endpoint address="http://localhost:4502/MyFirst.Web/MyWCFService.svc"

    binding="customBinding" bindingConfiguration="CustomBinding_MyWCFService"

    contract="ServiceReference2.MyWCFService" name="CustomBinding_MyWCFService" />

    <endpoint address="http://localhost:4502/MyFirst.Web/MyWCFService.svc"

    binding="customBinding" bindingConfiguration="CustomBinding_MyWCFService1"

    contract="ServiceReference3.MyWCFService" name="CustomBinding_MyWCFService1" /></client>



    Thursday, October 22, 2009 12:19 AM
  • Try changing




    hope this helps Smile

    Thursday, October 22, 2009 1:20 AM
  • Thanks Dude But i Have Used  Both Bindings as i m using multiple WCF services with diffferent binding s

    i m getting error for Basic HTTTP Binding where i m trying to consume one of My hosted silverlight WCF Service   

    Thursday, October 22, 2009 1:30 AM
  • Event if you are using multiple bindings wsHttpBinding doesnt work. So if you are using wsHttpBinding in your weg config file then just make if BasicHttpBinding.

    Hope that helps Smile

    Thursday, October 22, 2009 1:36 AM
  • actually i m using basichttpbinding only. so far after debugging thru project i m sure for one thing that there is no binding problem as when i m creating proxy  to call the asynch method it get connected. exception was rasied only when it was calling the service method to fetch the result. can u suggest me how to get thru if i m using normal asp Web services    

    Thursday, October 22, 2009 2:46 AM
  • Hi,

    NotFound exception doesn't contain much helpful info, please try config your service to pass exception details, then provide the detail exception message here.


    Thursday, October 22, 2009 2:53 AM
  • Hi there,

    My question is related to this, why do I only get "The remote server returned an error: NotFound" and not the FaultException raised in WCF? I have detail exceptions switched on at the WCF side, not running in debug mode, but still get no detail. It is available in Fiddler but I can't get to it on the Silverlight side. What am I missing please?


    Thursday, October 22, 2009 10:02 AM
  • Just found that SOAP faults do not propogate to Silverlight for reasons explained here, apparently will be addressed in future releases. There are workarounds explained but nothing like we used to in WCF.

    Thursday, October 22, 2009 11:57 AM