Solved

Self Hosted WebApi Accessible ony in Localhost (not over LAN=

Posted on 2014-07-21
1
871 Views
Last Modified: 2014-07-22
Hi all

I have created a self hosted webapi (appBuilder) that runs in a Windows Service.
If I call the api from windows testclient or from fiddler from localhost, it runs fine.
The service runs under my domainaccount .

The service has to be accessible over the LAN:
Therefore  I have called the command:
netsh http add urlacl url=http://+:2345/ user=<domain>\<my domainaccount> delegate=yes
 
Problem:
- After I have called the command, the service is not accessible over my IP and also no more from localhost.
- If I delete the reservation (with netsh delete) the service is accessible again from localhost

Base-Address: http://127.0.0.1:2345/
Code in startup.vb:
Dim config As New HttpConfiguration()
config.MapHttpAttributeRoutes()
config.Routes.MapHttpRoute(name:="DefaultApi", routeTemplate:="api/{controller}/{id}", defaults:=New With {Key .id = RouteParameter.[Optional]})
appBuilder.UseWebApi(config)

Code in OnStart:
  _server = WebApp.Start(Of Startup)(url:=baseAddress)

What do I have to do, to solve this problem?
Thanks
0
Comment
Question by:Honeymoon
1 Comment
 

Accepted Solution

by:
Honeymoon earned 0 total points
ID: 40211025
Hi all

I have found the solution myself...
As basadress (Start-Parameter) I had: "http://127.0.0.1:2345/"
I have changed this to: "http://*:2345/"
Now I can access the service on my own machine over my machine-IP-Address and also from another client over the LAN.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Transferring Country Domains 2 55
ASMX Service Client Debugging 5 128
ASP.NET WCF Rest service not working 6 78
HTTP POST URL 2 101
For some reason Google Apps has decided to reserve 'www' for your new domain which results in an error when trying to map the web address 'www' to a certain site in your Google Sites. The error is 'this address is already being used' and after some …
To properly understand GitHub, let’s divide it into two words ‘Git’ and ‘Hub’. Git is basically a ‘Distribution Version Control’ (DVC) and ‘Source Code Management’ (SCM) system widely used by software programmers while Hub means the efficient centre…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question