Web API seems to deploy but can't call any methods

Discussion in 'General troubleshooting' started by StephenInCanada, Jul 9, 2014.

  1. I'm new to Winhost so I'm ignorant.

    I've developed an MVC 4 webapi in VS 2012. It works perfectly on my home server (Windows 2012).

    When I deploy to Winhost, it looks okay and I can hit the helper page (see http://canadabeerfest.ca/beerfestapi). I can test too: http://canadabeerfest.ca/beerfestapi/Help/Api/GET-beerfestapi-Initialize-Ping

    But when I try to use the service, such as calling http://canadabeerfest.ca/beerfestapi/Initialize/ping I get a 404 error.

    I used the Winhost "Publishing Information" with VS 2012's Publish Web tool - importing this Publishing Information file.

    I tried changing the trust level to full in my web.config.

    The routing looks good.

    I can connect to the server and see the web application through IIS Manager (but can't do a lot of stuff that I normally can do).

    I don't see any logs (though I believe I've enabled them).

    Any ideas where it's going wrong?

    Cheers,

    Steve
     
    Last edited by a moderator: Oct 14, 2015
  2. FredC

    FredC Winhost Staff

    Sounds like some routing issue to me. I would check the routing first.
     
  3. Thanks FredC. You were right and I got it going...

    In the Windows Publishing wizard, under connections I had set the target to http://canadabeerfest.ca/beerfestapi... Fine. It was there. When I go to call the ping method, I was using http://canadabeerfest.ca/beerfestapi/Initialize/Ping which returned the 404. When I tried with http://canadabeerfest.ca/beerfestapi/beerfestapi/Initialize/Ping it worked. So the address needed to include the subfolder. I've since cleaned it up so that I don't have "beerfestapi" appearing twice; just "API".

    In hindsight, I should have seen this sooner.

    Cheers
     
  4. ComputerMan

    ComputerMan Winhost Staff

    Great! Thanks for posting what worked for you. :)
     
  5. Well, you know, it is beerfest...

    ;)
     
    ComputerMan and Elshadriel like this.

Share This Page