简体   繁体   English

以编程方式检查Http名称空间预留

[英]Programmatically check for Http namespace reservation

I have been tasked with writing a program which will run a set of diagnostic tests on our main application. 我的任务是编写一个程序,它将在我们的主应用程序上运行一组诊断测试。 One application uses WCF over HTTP (this is for interoperability reasons, so cannot be changed to use NET.TCp or any other flavour of WCF comms channel) and because it should not be running under elevated privileges it requires a HTTP Namespace reservation to be made ( https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/configuring-http-and-https ). 一个应用程序使用WCF over HTTP(这是出于互操作性的原因,因此不能更改为使用NET.TCp或任何其他类型的WCF通信通道),并且因为它不应该在提升的权限下运行,所以它需要进行HTTP命名空间预留( https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/configuring-http-and-https )。

My question is - is it possible to programmatically find out if the namespace reservation has been made in an OS agnostic manner (using C# / .NET 3.5 or 4)? 我的问题是 - 是否有可能以编程方式找出是否以操作系统无关的方式(使用C#/ .NET 3.5或4)进行命名空间预留? The only way I can think of doing this is to create a small WCF application which will try to communicate over the http channels I am interested in and catching an exception... but it seems like a really un-elegant way of solving my problem. 我能想到这样做的唯一方法是创建一个小WCF应用程序,它将尝试通过我感兴趣的http频道进行通信并捕获异常...但它似乎是解决我的问题的一种非常优雅的方式。

The reason I want to be able to find out is that a number of customers have 'forgotton' to make the reservation, and so it has been generating calls - the diagnostic program is aimed at checking well known issues such as this one and displaying a friendly warning because debugging WCF on a client site is just not my idea of fun. 我希望能够找到的原因是许多客户已经“忘记”进行预订,因此它一直在生成呼叫 - 诊断程序旨在检查诸如此类的众所周知的问题并显示友好的警告,因为在客户端站点上调试WCF不是我的乐趣。

AFAIK there is no programmatical ways to discover it unless you make a call to the service. 除非你打电话给AFAIK,否则没有程序化的方式来发现它。 ACL is setted up on a system level on the server side. ACL在服务器端的系统级别上设置。 Server doesn't share that kind of information. 服务器不共享这种信息。 The only answer you will be able to know whether access is granted or not. 您将能够知道是否授予访问权限的唯一答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM