Unable to get web api request on IIS 404 not found

0

I've created an ASP.NET Web API and tested it using IIS Express and everything works correctly. This web api need to be hosted in IIS 7 running on Windows Server 2008. I dont have access to the server, so I can only FTP to it. Once I host this web api in the server, I am unable to obtain any result of the api. I'm always receiving 404 - not found error.

This how the api request url looks like in IIS Express. http://localhost:59547/api/JSMachines

This is how the api request url looks like when hosted. http://myserver.rocket.com.my/api/JSMachines.

When the person in charge of the server make request from their localhost, they receive this error message.

Module IIS Web Core Notification MapRequestHandler Handler StaticFile Error Code 0x80070002 Requested URL http://myserver.rocket.com.my:80/api/JSMachines Physical Path D:\HostingSpaces\canonfoto\MyServer.rocket.com.my\wwwroot\api\JSMachines Logon Method Anonymous Logon User Anonymous

I have already tried to modify my web.config by adding

<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer> 

and I get same 404 error.

When I add this line to the web.config

  <handlers>
     <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
     <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />
  </handlers>

I get 500 Internal server error.

What could be the issue here?

iis
asp.net-web-api
iis-7
asked on Stack Overflow Aug 3, 2018 by batwing • edited Aug 3, 2018 by batwing

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0