我有一个IIS7托管服务,我需要向两个不同的客户端公开.对于其中一个客户端,我需要强制执行比另一个更严格的限制行为.
这意味着我需要定义两个标签,因为这些只能从标签中引用,那么我还需要其中两个?
我已经定义了以下web.config.问题是,当我尝试浏览到任一服务以便我可以提取元数据时,我收到以下错误:
Parser Error Message: A child element named 'service' with same key already exists at the same configuration scope. Collection elements must be unique within the same configuration scope (e.g. the same application.config file). Duplicate key value: 'WCFTwoEndpoints.Calculate'.
我是以正确的方式来做这件事的吗?
<system.serviceModel> <services> <service name="WCFTwoEndpoints.Calculate" behaviorConfiguration ="NotThrottled"> <endpoint address="http://localhost/WCFTwoEndpoints/Calculate.svc" binding="wsHttpBinding" bindingConfiguration="" name="Calculator" contract="WCFTwoEndpoints.ICalculate" /> <endpoint binding="mexHttpBinding" name="mex" contract="IMetadataExchange" /> </service> <service name="WCFTwoEndpoints.Calculate" behaviorConfiguration ="Throttled"> <endpoint address="http://localhost/WCFTwoEndpoints/ThrottledCalculate.svc" binding="wsHttpBinding" bindingConfiguration="" name="ThrottledCalculator" contract="WCFTwoEndpoints.ICalculate" /> <endpoint binding="mexHttpBinding" name="mex" contract="IMetadataExchange" /> </service> </services> <behaviors> <serviceBehaviors> <behavior name="NotThrottled"> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> <behavior name="Throttled"> <serviceMetadata httpGetEnabled="true" /> <serviceThrottling maxConcurrentCalls="19" /> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> </system.serviceModel>