For this, the best is to create another flow
with a request-response
VM inbound and a CXF client to consume the remote web service. The following explains how to generate the CXF client: http://www.mulesoft.org/documentation/display/current/Consuming+Web+Services+with+CXF
Then you can inject this other flow
in your component
via Component Bindings (see: http://www.mulesoft.org/documentation/display/current/Component+Bindings). That way org.example.HelloWorldImpl
will have the possibility to call the remote web service via an interface call that behind the scene calls a flow that performs the CXF client interaction.
So in your case, assuming:
- the CXF-generated service interface is
com.cdyne.wsf.WeatherWS
, - the method you're interested in is
getCityWeatherByZip
, - the CXF-generate service client is
com.cdyne.wsf.WeatherWS_Service
, - the
org.example.HelloWorld
class can receive an instance ofcom.cdyne.wsf.WeatherWS
by injection
you would have something similar to:
<flow name="soapservice">
<http:inbound-endpoint exchange-pattern="request-response"
address="http://localhost:60603/Hello" />
<cxf:jaxws-service serviceClass="org.example.HelloWorld" />
<component class="org.example.HelloWorldImpl">
<binding interface="com.cdyne.wsf.WeatherWS"
method="getCityWeatherByZip">
<vm:outbound-endpoint path="callGetCityWeatherByZip"
exchange-pattern="request-response" />
</binding>
</component>
</flow>
<flow name="getCityWeatherByZip">
<vm:inbound-endpoint path="callGetCityWeatherByZip"
exchange-pattern="request-response" />
<cxf:jaxws-client
clientClass="com.cdyne.wsf.WeatherWS_Service"
port="WeatherSoap" operation="GetCityWeatherByZip" />
<http:outbound-endpoint
address="http://wsf.cdyne.com/WeatherWS/Weather.asmx"
exchange-pattern="request-response" />
</flow>