简体   繁体   English

我可以有两个端点的WCF应用程序吗? 一种带有Windows安全性,另一种没有?

[英]Can I have a WCF application that has two endpoints. One with Windows Security and one without?

I have read several posts (here on SO and on MSDN) that supposedly show how I can have two endpoints for my WCF service. 我已经阅读了几篇帖子(在SO和MSDN上),这些帖子应该显示如何为WCF服务提供两个端点。 But and I can't seem to get this to work. 但是,我似乎无法使它正常工作。 I tried what they show, but it still does not work. 我尝试了它们显示的内容,但仍然无法正常工作。

Here is what I have now: 这是我现在所拥有的:

<system.serviceModel>
  <services>
    <service name="MyServiceProject.MyServiceClass">
      <endpoint address="MyService.svc"
                  binding="basicHttpBinding"
                  bindingName="normalBasicHttpBinding"
                  contract="MyContractsProject.IMyServiceClass" />

        <endpoint address="SecuredMyService.svc"
                  binding="basicHttpBinding"
                  bindingName="secureBasicHttpBinding"
                  contract="MyContractsProject.IMyServiceClass" />
    </service>
  </services>
  <bindings>
      <basicHttpBinding>
          <binding name="normalBasicHttpBinding" maxBufferSize="5242880"
                    maxBufferPoolSize="5242880"
                    maxReceivedMessageSize="5242880">
              <readerQuotas maxArrayLength="16384"
                            maxStringContentLength="5242880" />
          </binding>

        <binding name="secureBasicHttpBinding" maxBufferSize="5242880"
                    maxBufferPoolSize="5242880"
                    maxReceivedMessageSize="5242880">
          <security mode="Transport">
            <transport clientCredentialType="Windows" />
          </security>
          <readerQuotas maxArrayLength="16384"
                        maxStringContentLength="5242880" />
        </binding>
      </basicHttpBinding>
  </bindings>
  <behaviors>
      <serviceBehaviors>
          <behavior>
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true" />
          </behavior>
      </serviceBehaviors>
  </behaviors>
</system.serviceModel>

Variations on this that I have tried: 我尝试过的这种变化:

  • Taking out the security 取出安全
  • Having the first address be blank and the second just "secure" then going to http://MyNormalEndpoint/MyService.svc/secure (was blank and WCF Storm could not connect) 第一个地址为空白,第二个地址为“安全”,然后转到http://MyNormalEndpoint/MyService.svc/secure (为空,WCF Storm无法连接)
  • Adding a < Host> section that is a hard reference to the deploy path. 添加< Host>部分,该部分是对部署路径的硬参考。 (I don't want to do this as my service has to deploy to several different locations. But it did not work anyway) (我不想这样做,因为我的服务必须部署到几个不同的位置。但是无论如何都无法正常工作)
  • Having just one endpoint (the secure one) 只有一个端点(安全的一个)
  • Using two different binding types (wsHttpBinding). 使用两种不同的绑定类型(wsHttpBinding)。

None of these has worked. 这些都不起作用。

And now calls to my normal service are returning 404. (So I have messed something up). 现在,对我的普通服务的呼叫返回了404。(所以我搞砸了)。 If you want to see my original (working) config it can be found here . 如果你想看到我原来的(工作)的配置可以发现在这里

Thanks for any help. 谢谢你的帮助。

Are you sure you have proper formats for address 您确定地址格式正确吗

Specifying an Endpoint Address 指定端点地址

暂无
暂无

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

相关问题 配置WCF以使用两个端点之一 - Configuring WCF to use one of two endpoints WCF中相同服务的两个端点,一个不受保护 - Two endpoints for same service in WCF, one secured one not 两个WCF服务,托管在一个控制台应用程序中 - Two WCF services, hosted in one console application 在不同端点使用 UnitOfWork 设计。 当我尝试应用保存更改时无法跟踪实体更新。 #.net(工作单元设计) - Using UnitOfWork design at different endpoints. Can't tracking entity updates when I try to apply savechanges. #.net (UnitOfWork design) 使用wsHttpBinding并且没有Windows安全性的WCF会话 - WCF sessions with a wsHttpBinding and without windows security .NET WCF 应用程序可以与多个网络适配器一起使用吗? - Can a .NET WCF application work with more than one network adapter? 一个带有两个dll的Web应用程序。 一个dll依赖于另一个。 为什么必须同时更新两个DLL? - One web application with two dlls. One dll is dependent upon the other. Why do I have to update both DLLs? 在Windows应用程序的一个datagridview单元中绘制两个控件? - Ploting two controls in one datagridview cell in windows application? 如何在Windows窗体应用程序中生成从一个控件到另一个控件的“流”箭头? - How can I generate a 'flow' arrow from one control to another in a windows form application? 基本的wcf服务返回错误服务&#39;&#39;具有零个应用程序(非基础结构)端点 - basic wcf service returns error Service '' has zero application (non-infrastructure) endpoints
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM