Showing posts with label WCF. Show all posts
Showing posts with label WCF. Show all posts

Friday, November 7, 2014

Handling "AddressAccessDeniedException: HTTP could not register URL" error

Having self hosting WCF service one can get following exception:

AddressAccessDeniedException: HTTP could not register URL http://+:13025/

By default, listening at a particular HTTP address requires administrator privileges. Since application users does not often have such privileges it's necessary to allow port listening for particular user or group via nesth.

E.g.

netsh http add urlacl url=http://+:13025/applicationsvcs/booking user=DOMAIN\app_account

Proxying WCF service through the Fiddler

Set Fiddler as system wide proxy with preferred port (e.g. 8888).
Change app config of the WCF service host application as follows

<system.net>
  <defaultProxy
            enabled = "true"
            useDefaultCredentials = "true">
   <proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888"    usesystemdefault="false" />
  </defaultProxy>
</system.net>

That's it.