如何在 Windows 7 上为 WCF 3.0 REST 应用程序设置 HTTP ACL? [英] How do you set up HTTP ACL's for a WCF 3.0 REST application on Windows 7?

查看:37
本文介绍了如何在 Windows 7 上为 WCF 3.0 REST 应用程序设置 HTTP ACL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在阅读 O'Reilly 的RESTful .NET"并且正在使用 pg 上的示例程序.24 - 25. 这会设置一个自定义绑定来处理 REST 请求.当我执行代码时,它失败了,因为它没有权限设置侦听 http://localhost:8889/TestHttp

I have been reading O'Reilly's "RESTful .NET" and am working with the example program on pg. 24 - 25. This sets up a custom binding for handling REST requests. When I execute the code, it fails as it does not have permission to set up listening on http://localhost:8889/TestHttp

根据 MSDN (http://msdn.microsoft.com/en-us/library/ms733768%28VS.100%29.aspx),我需要配置 netsh.我正在使用以下 netsh 字符串:

According to MSDN (http://msdn.microsoft.com/en-us/library/ms733768%28VS.100%29.aspx), I need to configue netsh. I am using the following netsh string:

netsh http add urlacl url=http://localhost:8889/TestHttp user=DOMAIN\用户

netsh http add urlacl url=http://localhost:8889/TestHttp user=DOMAIN\user

其中 DOMAIN\user 是根据我的帐户自定义的.

where DOMAIN\user is customized to my account.

这似乎在额外的控制台窗口中处理,但执行我的代码会导致同样的失败.有谁知道如何解决这个问题?

This appears to process in an additional console window, but executing my code causes the same failure. Does anyone know how to fix this ?

谢谢,

斯科特

推荐答案

如果您使用的是 vista 或 Windows 7,则需要以管理员身份运行 cmd.exe 会话或 powershell,然后运行命令.

If you are on vista or windows 7 you need to run a cmd.exe session or powershell as administrator then run the command.

这篇关于如何在 Windows 7 上为 WCF 3.0 REST 应用程序设置 HTTP ACL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆