none
WebService NotFound Error

    General discussion

  • I have a problem with my Silverlight application, where I get NotFound returned on calls to my web service. I run the service on my local IIS install (Vista / IIS7) and looking at the logs it is "correct" in that IIS return a 404 everytime a POST is made to the service, though if it is a GET (browsing to the service) all is well.

    To make matters even more odd, I developed this under a different website initially, to simplify some of the potential problems and here it worked. The initial test web host is under the same website in IIS.

    Also it does not seem to matter if I configure the binding in code or use the clientconfig, I get the same problem.

    Can anyone tell me where I am going wrong here? I am tearing my hair out and everything I read to try does not help.

    Friday, January 09, 2009 8:31 AM

All replies

  •  Your best bet to use something like Fiddler or web developer helper to see exactly what is going on.  Maybe it is looking for a cross domain policy or there is a typo in the service url.

     

    http://silverlight.net/blogs/msnow/archive/2008/10/20/silverlight-tip-of-the-day-63-how-to-monitor-http-traffic-for-errors.aspx

    Friday, January 09, 2009 8:49 AM
  •  Hi, I had previously tried web dev helper and have just tried fiddler. However neither seem to show the web service calls from my silverlight application. The only way I can see what it is requesting is with the IIS logs. From there I can see that no request is made for a clientaccesspolicy.xml, etc. It goes from a successful GET for the xap to a failed (404) POST for the service.

     I do, if it were looking for it, have the following clientaccesspolicy.xml file:

    <?xml version="1.0" encoding="utf-8"?>
    <access-policy>
      <cross-domain-access>
        <policy>
          <allow-from http-request-headers="*">
            <domain uri="*"/>
          </allow-from>
          <grant-to>
            <resource path="/" include-subpaths="true"/>
          </grant-to>
        </policy>
      </cross-domain-access>
    </access-policy>

    Also, I have just been looking at my IIS logs, comparing the successful attempt from one site and the failed from another, and have just noticed. The failing site is configured for forms authentication (The Silverlight is a reporting control of a larger application), and I wondered if this could cause the problem. My web.config puts the service in a folder that anyone can access.

    Friday, January 09, 2009 12:13 PM
  •  Just a quick note, I have changed the site to require no authentication and tested - same error.

    Friday, January 09, 2009 12:22 PM
  • If you do not see a request for the clientaccesspolicy.xml then it is not needed.  This leaves us with a problem with the service.  What happens if you try and open the service in the browser? I am thinking there is an error with the service
    Friday, January 09, 2009 12:25 PM
  •  Hi Ken,

     Sorry for the delayed reply. If i open the service in the browser I get the normal IIS response and the logs show a successful GET for the service.

    I also expected there was an error in the service, so i have put error handling through out to log to both a text file and windows eventlog. Nothing in either.

    Thursday, January 15, 2009 3:51 AM
  • If this is a wcf service make sure you are using basichttpbinding.  What are you returning from the service? 

    Thursday, January 15, 2009 6:37 AM
  •  Yep, it is configured for basicHttpBinding. The return from the functions is a string of XML (because my objects were causing errors).

    I have the same service working in a simplier web application, and it is fine there. But when I move it to the full website I get these errors.

    There are a couple of bits that i thought may cause errors in the live site:

    1. It uses forms authentication, though the service is configured to allow everyone.
    2. It is under SSL, however I have configured the service to use transport-level security.
     
    Tuesday, January 20, 2009 4:14 AM
  • Try this thread

    http://silverlight.net/forums/t/18096.aspx

    Summary

    In inetpub\wwwroot\yourproject\ClientBin

    Open the .xap with winrar  - change the servicereferences.clientconfig - save the xap 

     

    Wednesday, January 21, 2009 8:52 PM
  • Finally found the problem, it was a url issue between the client and server. I just didn't see the wood through the trees.

     Thanks for your help everyone

    Thursday, February 19, 2009 6:56 AM
  • I able to bring up a web service on my local machine - http://localhost:49302/ProductService.svc

    However, if ProductService.svc is placed on the Web Server, within wwwroot, http://www.run4power.myphizzpop.com/ProductService.svc

    - An error to the effect of "resource can not be found" is received.

    On the other hand, I have clientaccesspolicy.xml in wwwroot, and I am able to browse -  

    http://www.run4power.myphizzpop.com/clientaccesspolicy.xml

    I don't believe I have access to IIS on the web server (Applied Innovations is the host).

    Is it possible that ProductService.svc needs to be modified, in order to run on the web server.

    Best regards, Rob

    Thursday, February 26, 2009 11:22 AM