[英]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: 我尝试过的这种变化:
http://MyNormalEndpoint/MyService.svc/secure
(was blank and WCF Storm could not connect) http://MyNormalEndpoint/MyService.svc/secure
(为空,WCF Storm无法连接) 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) 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 您确定地址格式正确吗
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.