How to Fix: WCF .SVC File Gives A 404 Error
Posted by on 08 December 2010 07:36 PM
|
|
Arvixe's servers all have WCF service installed by default. If visiting an SVC file gives a 404 error, it is most likely because the handler mappings for svc have been removed from your site somehow. To fix this, simply add the svc handlers to your web.config. The handlers described are below. Underneath them is an example of adding a managed handler(these would go into the <handlers> section of the web.config responsible for your application), if you need assisetance with writing the handler mappings many resources exist online as its a standard addition: 1)
Example of a managed handler: <add name=".svc" verb="*" path="*.svc" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
| |
|
I've have a WCF service on .NET 4.0 hosting on arvixe but my service but work. The error that recived on browser is not a 404. I've add the handler on my web.config like you said
<system.webServer>
<handlers>
<remove name="svc-Integrated-4.0" />
<add name="svc-Integrated-4.0" path="*" verb="*" type="System.ServiceModel.Activation.ServiceHttpHandlerFactory, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
Can anyone help me!?
Request path: *.svc
Type: System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Name: svc-Integrated-4.0
...even though I have this set to 4.0 Integrated.
Please help.
<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
<baseAddressPrefixFilters>
<add prefix="http://appservices.DOMAIN.COM" />
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
<system.webServer>
<handlers>
<add name=".svc" verb="*" path="*.svc" type="System.ServiceModel.Activation.ServiceHttpHandlerFactory, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</handlers>
</system.webServer>
2- this issue can solved for all site that using wcf service by adding Handler Mappings *.svc within iis on Hosting server
http://forum.arvixe.com/smf/programming-questions-tutorials/wcf-with-https/
You save my night!
I added following code in my web.config file
<system.webServer>
<handlers>
<add name=".svc" verb="*" path="*.svc" type="System.ServiceModel.Activation.ServiceHttpHandlerFactory, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</handlers>
</system.webServer>
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true">
</serviceHostingEnvironment>
</system.serviceModel>