同一 WCF 配置文件中的消息级安全性和传输级安全性
我正在尝试为我正在编写的 WCF 应用程序设置消息级安全性。该应用程序已经有一个设置了传输级安全性的端点。我可以设置另一个具有消息级安全性的端点吗?顺便说一下,这个应用程序是通过 IIS 运行的。我在同一个配置文件中设置了一个单独的服务,就像这样......
<service name="generalName">
<endpoint address=...>
.
.
.
</service>
<service name="generalName2">
<endpoint address=""...>
</service>
我问这个的原因是因为我认为我已经设置了所有内容并且我认为它可以工作。但是当我尝试访问以前的服务时,出现以下错误......
此服务的安全设置 需要 Windows 身份验证,但它 没有为 IIS 应用程序启用 托管此服务。
我知道前一个服务有效,因为我可以在设置第二个服务之前访问它。
对我有什么建议吗?我应该尝试在这里编写一个完全独立的服务还是有办法解决这个问题?
I am trying to set up message level security for a WCF application that I am writing. This application already has an endpoint that is set up with transport level security. Can I set up another endpoint that has message level security? This application is running over IIS by the way. I set up a separate service in the same config file like so...
<service name="generalName">
<endpoint address=...>
.
.
.
</service>
<service name="generalName2">
<endpoint address=""...>
</service>
The reason I ask this is because I think I have set everything up and I think It could work. But when I try and access the previous service I get the following error...
Security settings for this service
require Windows Authentication but it
is not enabled for the IIS application
that hosts this service.
I know the previous service works because I could access it before I set up the second service.
Any advice for me? Should I just try and write a completely separate service here or are there ways around this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不知道您使用什么绑定 - 取决于该绑定是否支持传输和消息安全 - 是的,当然您应该能够公开两个端点,一个具有传输安全性,另一个具有消息安全性。
由于这实际上只是具有两个端点的一个服务,因此您的配置应该如下所示(我选择
wsHttpBinding
作为示例 - 根据需要进行调整):基本上,您定义了两个绑定配置,然后您的一项服务就有两个端点,一个使用传输安全绑定配置,另一个端点使用消息安全绑定配置。
这两个端点当然不能具有相同的地址 - 因此您需要为每个端点提供两个单独的(相对)地址。
Not knowing what binding you use - depending on whether that binding supports both transport and message security - yes, of course you should be able to expose two endpoints, one with transport security, the other with message security.
Since this is really only one service with two endpoints, your config should look something like this (I picked
wsHttpBinding
as my sample - adapt as needed):Basically, you define two binding configurations, and then you have two endpoints for your one service, one using the transport security binding configuration, the other endpoint using the message security binding configuration.
Those two endpoints of course cannot have the same address - so you need to give two separate (relative) addresses to each of the endpoints.