두 개의 다른 클라이언트에 노출해야하는 IIS7 호스트 서비스가 있습니다. 클라이언트 중 하나는 다른 것보다 더 엄격한 제한 동작을 시행해야합니다.WCF 단일 서비스 구현, 다중 동작. 가능
이것은 두 개의 태그를 정의해야한다는 것을 의미하며 태그에서 참조 할 수 있기 때문에 이들 중 두 개가 필요합니까?
다음 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>
는 Calculate.svc 및 ThrottledCalculate.svc – Rajesh
예 나는 2 개 개의 다른 SVC는 파일을해야합니까라는 2 개 개의 다른 SVC는 파일을 가지고 있지만 그들은 같은 .cs에 둘 점은 내가 코드와 동일한 클래스 이름을 가진 같아요 –
뒤에하면됩니다 WCF는 서비스 요소가 고유해야하며 동일한 이름을 가진 두 개의 서비스 요소가 있다고 예상하므로 문제가 발생합니다. 기능을 기본 클래스로 푸시 한 다음 다른 클래스에서 상속하여 서비스 이름을 고유하게 만들 수 있습니까? – Rajesh