Reputation: 28
Can you please help me and provide any example or scenario in which I can invoke db call using flow from web service operation. if my web service implementation have five operations and each operation has to call a separate query or stored procedure.
I have the other way around by injecting database template using spring injection and call the required query or stored procedure but I want to do it with flows.
Upvotes: 0
Views: 151
Reputation: 11606
Take a look at CXF proxy service:https://docs.mulesoft.com/mule-user-guide/v/3.7/proxying-web-services-with-cxf
It allows to access the raw SOAP message and route it how you wish, such as using a choice router using Xpath on the operation name, or you could extract the SOAPAction header etc.
<flow name="soap-api" doc:name="soap-api-orders">
<https:.... />
<cxf:proxy-service payload="body"
service="MyService-v1c" namespace="http://xmlns.oracle.com/MyService"
wsdlLocation="wsdl/MyService.wsdl" enableMuleSoapHeaders="false"
doc:name="CXF" />
<choice doc:name="Choice">
<when
expression="#[xpath('boolean(//mynamespace:MyOperation1/node()[1])')]">
<flow-ref name="flow1" />
</when>
<when
expression="#[xpath('boolean(//mynamespace:MyOperation2/node()[1])')]">
<flow-ref name="flow2" />
</when>
<otherwise>
</otherwise>
</choice>
</flow>
Upvotes: 0