325.14. 既存のエンドポイントマッピングを使用した代替設定

mapping-type beanname を持つすべてのエンドポイントに対して、対応する名前を持つタイプ CamelEndpointDispatcher の 1 つの Bean が Registry/ApplicationContext に必要です。この Bean は、Camel エンドポイントと PayloadRootQNameEndpointMapping などの既存の エンドポイントマッピング の間のブリッジとして機能します。

注記: beanname mapping-type の使用は、主に、すでに Spring-WS を使用しており、Spring XML ファイルでエンドポイントマッピングが定義されている (レガシー) 状況を対象としています。beanname マッピングタイプを使用すると、Camel ルートを既存のエンドポイントマッピングに接続できます。ゼロから始める場合は、設定が少なくて済み、表現力が高いため、(上の endpointMapping で示したように) エンドポイントマッピングを Camel URI として定義することをお勧めします。または、アノテーションを使用してバニラ Spring-WS を使用することもできます。

beanname を使用したルートの例:

<camelContext xmlns="http://camel.apache.org/schema/spring">
    <route>
        <from uri="spring-ws:beanname:QuoteEndpointDispatcher" />
        <to uri="mock:example" />
    </route>
</camelContext>

<bean id="legacyEndpointMapping" class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
    <property name="mappings">
        <props>
            <prop key="{http://example.com/}GetFuture">FutureEndpointDispatcher</prop>
            <prop key="{http://example.com/}GetQuote">QuoteEndpointDispatcher</prop>
        </props>
    </property>
</bean>

<bean id="QuoteEndpointDispatcher" class="org.apache.camel.component.spring.ws.bean.CamelEndpointDispatcher" />
<bean id="FutureEndpointDispatcher" class="org.apache.camel.component.spring.ws.bean.CamelEndpointDispatcher" />