Just the way you will consume it in any other application; console, WPF etc. All that you would need is an
HttpClient
object and the rest is all documented. :-) Like you have mentioned, you wanted to open it up at "localhost:8080", are you sure that is the location where your API is currently hosted at? Typically, there is a different port unless you want to override everything (
which, you should never do!).
Quote:
i trying to add hosted services on my mvc project through add web "add service refrence"
You are confusing Web API with WCF;
Web API does not need that much of stupid stuff, to adding service references etc, all you need is an HttpClient and you're done. Rest of the stuff is taken care of by the HTTP protocol and you can consume the API easily, for example the following would work,
var client = new HttpClient();
client.BaseAddress = new Uri("http://localhost:8080/api");
var something = client.GetAsync("casestatusall");
Have a look at my articles as well, they will guide you on this topic as well.
A Tip for Ajax Developers in ASP.NET MVC Framework[
^]
ASP.NET 5 Web API RESTful CRUDs and Windows 10 native application[
^]
For more as well, you can look for a proper documentation on HttpClient object and how the HTTP protocol works.