我有一个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>
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。