몇 가지 다른 문화권 용으로 지역화해야하는 WCF 서비스가 있는데, 주로 다른 언어로 오류 및 응답 메시지를 제공합니다. 요청 헤더의 구문 분석에 의존하는 대신 각 지원 문화권마다 서로 다른 끝점을 제공하는 방향으로 기울이고 있습니다.WCF가 web.config에서 다른 culture 끝점을 설정했습니다.
<system.serviceModel>
<services>
<service name="MyCompany.Service.Rest.SomeService">
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
<endpoint address="" binding="webHttpBinding" behaviorConfiguration="WebBehavior" contract="MyCompany.Service.Rest.ISomeService"/>
<endpoint address="fr" binding="webHttpBinding" behaviorConfiguration="WebBehaviorFrench" contract="MyCompany.Service.Rest.ISomeService"/>
<endpoint address="cn" binding="webHttpBinding" behaviorConfiguration="WebBehaviorChinese" contract="MyCompany.Service.Rest.ISomeService"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="WebBehavior">
<webHttp/>
</behavior>
<behavior name="WebBehaviorFrench">
<webHttp/>
<culture value="fr" />
</behavior>
<behavior name="WebBehaviorChinese">
<webHttp/>
<culture value="zh-cn" />
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
: 나는의 라인을 따라 내 Web.config의 그것을 구성 할 수 필요가 가능한 것으로
http://server/mycompany-rest/v1.0/service.svc
http://server/mycompany-rest/v1.0/service.svc/fr
http://server/mycompany-rest/v1.0/service.svc/cn
나는이 방법을 위해 생각 예를 들어 나는의 라인을 따라 서로 다른 URL을 것
끝점 동작에 대한 culture 요소가 없다는 것을 알고 있지만 사용자 지정 동작으로이 접근법을 사용할 수 있습니까? 또는 대안으로 더 좋은 방법이 있을까요?