locked
Web Api service on website RRS feed

  • Question

  • User1624680431 posted

    Hello,

    I am new to web api aplications. I have made a new web api service and on localhost it works just fine and returns json on link:

    http://localhost:1996/api/controller/

    but when i deploy it on my website that is windows hosted with support for asp.net it returns me an error 404 on link

    http://www.website.com/api/controller/

    Why is this and what am i missing? Is it the IIS settings on website, because my host is only letting me use simple control panel for my website where i cannot configure IIS?

    Thank you

    Wednesday, December 9, 2015 5:57 PM

All replies

  • User-1946294156 posted

    Do you have access to the Server it's self?  The best and easiest way, that I know of, is to go to the Server, open IIS, and navigate to the Web Site/Application and click on browse the website from there.  This will assist you in getting the exact path.  Just replace localhost with your domain. 

    If not, which means you are hosting with a 3rd party, you can try to determine this from your FTP connection, just find out where the root of the web site is and trace up. 

    If you are using the a 3rd party and are still having issue, I would contact them.

    Wednesday, December 9, 2015 6:02 PM
  • User1624680431 posted

    I am using a 3rd party host/provider.

    I can see my deployed files in root of www.website.com/www folder Global.asax,packages.config,Web.config,service.html page and bin folder in root of website.

    So i only call www.website.com/api/controller as /api/controller are my rooting settings and it only returns me 404 error. If i call index.html that is in the same folder it works on www.website.com/index.html

    Wednesday, December 9, 2015 6:16 PM
  • User-219423983 posted

    Hi Sic,

    I can see my deployed files in root of www.website.com/www folder Global.asax,packages.config,Web.config,service.html page and bin folder in root of website.

    I assume you host all of you project files under the “www” folder. If so, you could try to call the “www.website.com/www/API/Controller” to check it could return your expected result.

    Besides, dose the ”index.html” also in the “www” folder and you could access it by “www.website.com/index.html”? Does the “Inde.html” is your own file?

    Best Regards,

    Weibo Zhang

    Friday, January 29, 2016 3:33 AM