REST 기반 서비스를 위해 WCF 4에서 새 WCF 라우팅 서비스를 사용할 수 있습니까? 나는 리버스 프록시와 비슷한 것을 염두에두고있다. 기본적으로 나는 동일한 기본 URL과 포트를 가진 IIS를 통해 공개하고자하는 셀프 호스트 기반의 서비스 목록을 가지고있다. 라우팅은 URL의 마지막 부분에 의해 수행되어야합니다. 나는 WCF 라우팅 서비스에 대해 절대적으로 새로운 것이므로 어리석은 질문이라면 저를 용서해주십시오. 그러나 웹에서 그 정보를 찾을 수는 없습니다. (serivce1/2는 selfhosted 서비스입니다) 나는 이런 식으로 뭔가를 시도.net 4 WCF 라우팅 서비스 + REST
:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="RoutingBehavior">
<routing routeOnHeadersOnly="false" filterTableName="RoutingTable"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="RoutingBehavior" name="System.ServiceModel.Routing.RoutingService">
<endpoint address="myservices" contract="System.ServiceModel.Routing.IRequestReplyRouter" binding="basicHttpBinding"/>
</service>
</services>
<routing>
<filterTables>
<filterTable name="RoutingTable">
<add filterName="service1Filter" priority="0" endpointName="service1"/>
<add filterName="service2Filter" priority="0" endpointName="service2"/>
</filterTable>
</filterTables>
<filters>
<filter name="service1Filter" filterType="MatchAll"/>
<filter name="service2Filter" filterType="MatchAll"/>
</filters>
</routing>
<client>
<endpoint address="http://somehost:8888/test/service1" binding="basicHttpBinding" contract="*" name="service1"/>
<endpoint address="http://somehost:8732/test/service2" binding="basicHttpBinding" contract="*" name="service2"/>
</client>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
하지만이 작동하지 않습니다. 예외가 발견되지 않는 엔드 포인트가 나타납니다. http://somehost:8888/test/service1 ist 실제 호스트가 아닌 자체 호스트 서비스의 기본 주소입니다. 기본 주소를 기반으로 라우팅을 수행 할 수 있습니까 (아니면 나머지 라우팅이 가능한 경우) 모든 끝점에 대한 경로를 추가해야합니까?
아마 나는 WCF 라우팅 서비스를 놓쳤을 것이라고 생각합니다. ARR과 같은 "실제"역방향 프록시를 사용하겠습니다. – Jeldrik