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.
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.
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"?>
<resource path="/" include-subpaths="true"/>
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.
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.
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:
- It uses forms authentication, though the service is configured to allow everyone.
- It is under SSL, however I have configured the service to use transport-level security.
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 -
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