Quantcast
Channel: WCF Rest IIS7 Returning 404.0 error.
Viewing all articles
Browse latest Browse all 6

WCF Rest IIS7 Returning 404.0 error.

$
0
0

Hi,

I am using the 4.0 Framework and am using the routing in the global.asax to avoid using the .svc files.  I have compiled my test project and this is running fine locally using IIS 7 with Windows 7.  When I take the same files and deploy to an application on the server I get 404 errors when I try to hit my service method.  Is there something that has to be installed on the windows 2008 server that would make it recognize the routing?

Config file:

<?xml version="1.0"?>
<configuration>
 
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
    <httpRuntime maxRequestLength="65536"  executionTimeout="36000"/>
  </system.web>
  <system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="67108864"></requestLimits>
        <!--64 Mb-->
      </requestFiltering>
    </security>

    <modules runAllManagedModulesForAllRequests="true">
      <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </modules>
  </system.webServer>

  <system.serviceModel>
    <serviceHostingEnvironment  aspNetCompatibilityEnabled="true"/>
    <standardEndpoints>
      <webHttpEndpoint>
        <!--
            Configure the WCF REST service base address via the global.asax.cs file and the default endpoint
            via the attributes on the <standardEndpoint> element below
        -->
       
        <standardEndpoint  maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" maxBufferSize="2147483647"  name="" helpEnabled="true" automaticFormatSelectionEnabled="true"/>
      </webHttpEndpoint>
    </standardEndpoints>
  </system.serviceModel>

</configuration>

 

Global asax

 public class Global : HttpApplication
    {
        void Application_Start(object sender, EventArgs e)
        {
            RegisterRoutes();
        }

        private void RegisterRoutes()
        {
            // Edit the base address of Service1 by replacing the "Service1" string below
            RouteTable.Routes.Add(new ServiceRoute("UploadFile", new WebServiceHostFactory(), typeof(UploadFile)));
        }
    }

Thanks,

J


Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles



Latest Images