none
Change baseAddress of web service encountered error RRS feed

  • Question

  • I created a WCF web service and it original base address was some typical url. I changed this url into app.config file 

            <host>
              <baseAddresses>
                <add baseAddress="http://localhost:8080/myEvaltest" />
              </baseAddresses>
            </host>

    but as I re ran this i got an error:

    Please try changing the HTTP port to 8733 or running as Administrator. System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http://+:8080/

    I reopened visula studio by "Run as admin" and it worked fine. Error didn't appear this tiime.

    Please let me know why I saw this error message and is there any alternate solution for this.

    Any help is highly appreciated.

    Many thanks in advance.

    Vivek


    Best Regards, vivek

    Saturday, October 19, 2013 5:16 PM

Answers

  • The folder myEvaltest need to be shared.  An admin will automatically have remote access to all folders while regular users won't.  On a windows explorer right click the folder myEvaltest and select properties - sharing.

    jdweng

    Saturday, October 19, 2013 9:02 PM
  • Hi,

    The problem is that in Vista, Server 2008, Win7 etc the HTTP address space is managed by a kernel driver called http.sys. To have requests forwarded to your process by http.sys requires registering the http namespace which is a privileged operation.

    If your code runs elevated as an admin then you don't see this issue but that is not a recommended configuration. Instead what you should do is tell http.sys that your process expects to open this part of the address space and its ok

    You do this from an elevated console using the following command:

    netsh http add urlacl url=http://localhost:8080/myEvaltest/user=<the user account of the service>

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 21, 2013 1:07 AM
    Moderator

All replies

  • The folder myEvaltest need to be shared.  An admin will automatically have remote access to all folders while regular users won't.  On a windows explorer right click the folder myEvaltest and select properties - sharing.

    jdweng

    Saturday, October 19, 2013 9:02 PM
  • Hi,

    The problem is that in Vista, Server 2008, Win7 etc the HTTP address space is managed by a kernel driver called http.sys. To have requests forwarded to your process by http.sys requires registering the http namespace which is a privileged operation.

    If your code runs elevated as an admin then you don't see this issue but that is not a recommended configuration. Instead what you should do is tell http.sys that your process expects to open this part of the address space and its ok

    You do this from an elevated console using the following command:

    netsh http add urlacl url=http://localhost:8080/myEvaltest/user=<the user account of the service>

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 21, 2013 1:07 AM
    Moderator