Camelを使用して実際のWebサービスをプロキシするのはかなり簡単です。
最小限のルーティングで、これを実現できる以下の(上記のエンドポイントからの国別Webサービスを考慮してください)を参照してください。ただし、さらに検証する必要があるか、処理ロジックを実行するか、メディエーション中に何らかの変換を行うなど、ユースケースに応じて行うこともできます。
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
<!-- CurrencyService Proxy Endpoint -->
<cxf:cxfEndpoint id="currencyServiceProxyEP" xmlns:c="http://www.webserviceX.NET"
endpointName="c:countrySoap" serviceName="c:country"
loggingFeatureEnabled="true" address="/CurrencyService/MyGatewayProxy" wsdlURL="WSDL/CountryService.wsdl">
<cxf:properties>
<entry key="dataFormat" value="MESSAGE" />
</cxf:properties>
</cxf:cxfEndpoint>
<!-- CurrencyService Actual Endpoint -->
<cxf:cxfEndpoint id="currencyServiceActualEP" xmlns:c="http://www.webserviceX.NET"
endpointName="c:countrySoap" serviceName="c:country"
loggingFeatureEnabled="true" address="http://www.webservicex.net/country.asmx" wsdlURL="WSDL/CountryService.wsdl">
<cxf:properties>
<entry key="dataFormat" value="MESSAGE" />
</cxf:properties>
</cxf:cxfEndpoint>
<camelContext xmlns="http://camel.apache.org/schema/blueprint" id="CountryService-Context">
<route id="proxyEPRoute">
<from uri="cxf:bean:currencyServiceProxyEP" />
<!-- Do Extra validation of payload, additional routing, processing, transaformation, mediation etc.. depending on your use case here.. -->
<to uri="cxf:bean:currencyServiceActualEP"/>
</route>
</camelContext>
</blueprint>
ノートを行います:
しかし、ちょうどこの実際のエンドポイントにカスタムエンドポイントからプロキシ要求に最低でも
が必要なものです私は露出させるための青写真のDSLとキャメルCXFとキャメルのルートを使用していますし、 SOAPエンドポイントを消費します。
このトピックに関するこのような多くの情報を読んでいれば、問題の解決にこれをどれだけ適用できないかを分かち合うとよいでしょう。 – ImportanceOfBeingErnest