HTTP Error 404.0 - Not Found when accesing SVC service - iis-8

I have REST service application which is hosted in an IIS 8 in a Windows 8 PC. When I request the service I am getting an error as follows ... HTTP Error 404.0 - Not Found.
Here is the detailed error message.
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
Most likely causes:
•The directory or file specified does not exist on the Web server.
•The URL contains a typographical error.
•A custom filter or module, such as URLScan, restricts access to the file.
Things you can try:
•Create the content on the Web server.
•Review the browser URL.
•Create a tracing rule to track failed requests for this HTTP status code and see which module is calling SetStatus. For more information about creating a tracing rule for failed requests, click here.
Detailed Error Information:
Module IIS Web Core
Notification MapRequestHandler
Handler StaticFile
Error Code 0x80070002
Requested URL http://IP.com/Wining/RService.svc/general
Physical Path C:\inetpub\wwwroot\Wining\RService.svc\general
Logon Method Anonymous
Logon User Anonymous
Any help on this would be greatly appreciated.

There are myriads of possible causes. In general, the target resource at given URL is not found, so it may be simply missing, misconfigured, not started, etc. First - check the server logs, they usually contain more detailed information about the issue.
Also, please doublecheck that the service really is up and running. Connect to the www server and check it via localhost not ip.com.
I'm not an expert, but judging from the snippet you provided, it seems to be WCF service, the Handler: StaticFile seems very odd. It seems like the IIS misinterpretes your request as a StaticFile (a resource read from the disks and just passed-through without any further processing) which for me seems perfectly wrong.
You may have not installed the service properly, or have url mappings and/or handlers messed up, or you may even have NET/ASP framework not properly installed.. What have you installed first? .Net or IIS?
check similar questios, there are many.. for example:
WCF on IIS8; *.svc handler mapping doesn't work
HTTP 404 when accessing .svc file in IIS

I had to enable HTTP Activation in .NET Framework 4.5 Advanced Services > WCF Services (running on WIndows 2012) and after an IISReset it worked fine.

Related

Silverlight Security Issue Help - Debugging resource strings are unavailable.

I hosted silverlight application iis and that can be accessed in multiple ways..
When I access using Qualified name of server IP address IT WORKS fine:
http://[QUALIFIEDNAME]/WebUAT/App.aspx
When I access using IP address like below:
http://[IPADDRESS]/WebUAT/App.aspx
It gives error below:
[Async_ExceptionOccurred]
Arguments:
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.20913.00&File=System.dll&Key=Async_ExceptionOccurred StackTrace : at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
Follow these,
(i) Try to use fiddler and find the request which is making crossdomainpolicy xml request.
(ii)Check whether it is failing, if so add the crossdomain and clientaccesspolicy to the root folder of your Application
(iii)Check whether the service which is invoked by your application is blocked by firewall.

Response 400 (bad request) when invoking WCF service with other user than Administrator

I have a simple WCF service (hosted in Server01) which I've been using with no problems. After installing in this particular server (lets call it ClientServer01), I started to get the response 400.
So we have the following two cenarios.
Call WCF service from ClientServer01 from myApp.exe running as Administrator - Works
Call WCF service from ClientServer01 from myApp.exe running as CustomUser - Crashes
Aditional data:
ClientServer01 uses a proxy that is inside it's network to communicate
I'm able to ping Server01 from ClientServer01 using cmd running as Administrator and CustomUser both
Already tried setting expect100Continue="false" as described here
I've made MyApp.exe to isolate the problem and for debugging purposes, the real application is an IIS website in ClientServer01
The service is not a big deal. Pretty basic unsecured WCF service with BasicHttpBinding
Before asking, I tried to analyse the request with fiddler, it worked, because the component that was really making the request was fiddler. Today I tried it again, but running fiddler as mycustom user here is the output:
ERROR
The requested URL could not be retrieved
The following error was encountered while trying to retrieve the URL:
/MyServiceAppName/MyServiceName.svc
Invalid URL
Some aspect of the requested URL is incorrect.
Some possible problems are:
• Missing or incorrect access protocol (should be “http://” or similar)
• Missing hostname
• Illegal double-escape in the URL-Path
• Illegal character in hostname; underscores are not allowed.
Your cache administrator is webmaster.
Generated Mon, 27 May 2013 13:58:09 GMT by fw3.companyhostname.com.br
(squid/3.1.11)
Am I missing some server, proxy or WCF configuration that would allow CustomUser to make an http request thought port 80 to a basic WebService?
Thanks
CustomUser's proxy was not configured. So UseDefaultWebProxy would refer to an invalid proxy.
There are some solutions to this kind of problem
Set target user proxy settings (the most appropriate IMO)
Set binding ProxyAddress property
Set default app proxy in .config file tag configuration/system.net/defaultProxy/proxy <proxy proxyaddress="http://ip:port" />

Unable to reference WSDL of WCF web service hosted on AppFabric

I have developed a WCF service and, while in Visual Studio 2010, I can import the WSDL without a problem. After I've deployed it to AppFabric, I get the WSDL, but several schema files referenced internally in the WSDL cannot be found, for some reason. I don't know if it's a configuration issue, or what. The error I get when I try to process the WSDL in Visual Studio 2010 follows below:
Metadata contains a reference that cannot be resolved:
'http://myserver.mydomain.com:9871/app_deploy/MyAppService.svc?wsdl'.
The WSDL document contains links that could not be resolved.
There was an error downloading 'http://myserver.mydomain.com:9871/app_deploy/MyAppService.svc?xsd=xsd0'.
The request failed with HTTP status 502: Proxy Error ( The
specified network name is no longer available. ).
Metadata contains a reference that cannot be resolved:
'http://myserver.mydomain.com:9871/app_deploy/MyAppService.svc'.
There was no endpoint listening at http://myserver.mydomain.com:9871/app_deploy/MyAppService.svc
that could accept the message. This is
often caused by an incorrect address
or SOAP action. See InnerException, if
present, for more details.
The remote server returned an error: (404) Not Found.
If the service is defined in the current solution, try building the
solution and adding the service reference again.
The error is a proxy error because it goes through a proxy, but the error is because the page isn't there. I've tried accessing http://localhost:9871/app_deploy/MyAppService.svc?xsd=xsd0 at the server, but I get 404.
Why wouldn't these xsd files being found? Is it a deployment issue?
Any help would be greatly appreciated.
Man, I finally found the problem here. I needed write permission on C:\Windows\Temp for Application Pool user!

Why would an SSL/Basic Authentication WCF service start throwing a 404?

I have a WCF service that has been working flawlessly for 3 months. It is consumed by local clients on the same server hosting the WCF service and local network clients. It uses SSL and basic authentication for security.
A few nights ago, the local client (local network clients not affected) started receiving 404 errors whenever it tried to use the service. I am able to open a browser on the server hosting the WCF and view the WSDL and even call the "put" command and get the expected "method not allowed". I have confirmed that no software or hardware changes have been made to the hosting server. I have confirmed that the SSL key is valid. I have confirmed that the permissions for the Application Pool are sufficient. I have confirmed that no firewall is running. The only thing odd is the IIS log showing that the first post does not contain the basic authentication user. However, the next line in the log does and shows a 200 response. I am not entirely sure that log is not normal. See below. I was hoping somebody could give me another place to research to find the problem. Please let me know.
2010-08-28 10:30:03 192.168.100.100 POST /protected/Service_Name_Here.svc/put - 443 - 192.168.100.100 - 401 2 5 2
2010-08-28 10:30:03 192.168.100.100 POST /protected/Service_Name_Here.svc/put - 443 User_Name_Here 192.168.100.100 - 200 0 0 5
EDIT: The local client that is throwing the error is transferring large files to the WCF service. The local network clients are transferring small files and not throwing the error. I found this link that suggests that the default transferMode="Buffered" will throw a 404 for files above 20 MB file. The fix for this person was to change the transferMode="Streamed". However, the "Streamed" setting only allows 1 parameter to be passed to the WCF service. I have multiple parameters so I need to find a fix for "buffered" mode.
The fix for this person was to change the transferMode="Streamed". However, the "Streamed" setting only allows 1 parameter to be passed to the WCF service. I have multiple parameters so I need to find a fix for "buffered" mode.
Sounds like that's the correct fix, however the caveat is that streamed mode requires custom message contracts; you can't use the "RPC" style that WCF pushes as a default for operations. If you need to provide more than one parameter in a streamed mode transfer, simply add them to your custom message contract.
Here's a nice discussion on the subject from Microsoft.
If you have problems with message size be aware that there are 3 levels of configuring accepted request size for IIS:
WCF - default max message size 65KB (maxReceivedMessageSize)
ASP.NET runtime hosting WCF - default max request size is 4MB (maxRequestLength)
IIS 7 with request filtering installed - default max request size about 28MB (maxAllowedContentLength)
If WCF rejects your message you will probably get meaning full error but for ASP.NET and IIS you will get exactly HTTP 404.
Streaming will not help you unless you change your operations.

Publishing my WCF Service to my webhotel provider

I have made a small log service that i want to publish to a subdomain on my webhotel. I make the wcf service and test it locally - no problem. I then go to the [Build] menu and choose [Publish], type in my FTP location and publishes it to the location. No problems.
The problem arise when i need to use it, i try to navigate to the .svc file but gets this error:
This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
Parameter name: item
What am I doing wrong?
That's because of your IIS configuration. This has already been discussed here: WCF service startup error "This collection already contains an address with scheme http"
Solved! The problem is that i cannot access the IIS configuration, since its on a hosted environment. The solution is described on my blog, since i had so much trouble getting this to work.
http://www.vikingworks.dk/post/WCF-Service-on-hosted-environment.aspx