Solved

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

Posted on 2014-07-21
1
812 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

New My Cloud Pro Series - organize everything!

With space to keep virtually everything, the My Cloud Pro Series offers your team the network storage to edit, save and share production files from anywhere with an internet connection. Compatible with both Mac and PC, you're able to protect your content regardless of OS.

Join & Write a Comment

These instructions are based on installing Owncloud on your new raspberry pi connected with a usb HDD. What do you need Part A? A Raspberry Pi, model B. A boot SD card for the Raspberry Pi. A usb HDD An Ethernet cable to connect to the lo…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

706 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now