lundi 4 septembre 2017

how to host web service

I created an ASP.NET web application (Web api,no MVC). I wrote the code for the post method and tested locally.

Now I have a ip address(10.10.50.00) and a hostname = test to expose this application to be consume by a client in a different computer.

How can i configure my app to use the ip and be exposed to be consume?

    Public Module WebApiConfig
       Public Sub Register(ByVal config As HttpConfiguration)
        ' Web API configuration and services
        ' Web API routes
        config.MapHttpAttributeRoutes()

        config.Routes.MapHttpRoute(
            name:="DefaultApi",
            routeTemplate:="api/{controller}/{id}",
            defaults:=New With {.id = RouteParameter.Optional}
        )
    End Sub
End Module


##nsume




Aucun commentaire:

Enregistrer un commentaire