HTTP Error 404.0 - Not Found when accesing WCF SVC service

arjunsingh
 
on Apr 15, 2015 01:01 AM
4222 Views

I wanna host a wcf service that only GET data

It works fine on my Localhost but when i host on url it gives error

 

Detailed Error Information:
Module	   IIS Web Core
Notification	   MapRequestHandler
Handler	   StaticFile
Error Code	   0x80070002
Requested URL	   http://riskycoder.com:80/Service1.svc/singleword/hi
Physical Path	   G:\PleskVhosts\riskycoder.com\httpdocs\Service1.svc\singleword\hi
Logon Method	   Anonymous
Logon User	   Anonymous

I dont know whats the issue

 My config

<?xml version="1.0"?>
<configuration>
<appSettings></appSettings>
  <connectionStrings>

    <!--<add name="NewTestConnectionString" connectionString="Data Source=RHC-PC;Initial Catalog=NewTest;Integrated Security=True"
      providerName="System.Data.SqlClient" />-->
   
 </connectionStrings>
<system.web>
  <customErrors mode="Off">
  </customErrors>
</system.web>
<system.webServer>
  <httpErrors errorMode="Detailed"></httpErrors>
  <validation validateIntegratedModeConfiguration="false"/>
</system.webServer>
<system.serviceModel>
  <serviceHostingEnvironment multipleSiteBindingsEnabled="true">
    <baseAddressPrefixFilters>
      <add prefix="htttp://www.riskycoder.com/"/>
    </baseAddressPrefixFilters>
  </serviceHostingEnvironment>
<services>
  <service name="StressApi.Service1" behaviorConfiguration="StressApi.Service1Behavior">
    <endpoint address="../Service1.svc" binding="webHttpBinding" contract="StressApi.IService1" behaviorConfiguration="webBehaviour">
      
    </endpoint>
             
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="StressApi.Service1Behavior">
      <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
  </serviceBehaviors>
<endpointBehaviors>
  <behavior name="webBehaviour">
    <webHttp/>
  </behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
  </configuration>

 

Download FREE API for Word, Excel and PDF in ASP.Net: Download
arjunsingh
 
on Apr 15, 2015 03:46 AM

I added this and it worked.

 <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>