Mule 从 cxf soap 服务调用数据库连接器以在每个方法中调用多个存储过程
Mule invoking database connector from cxf soap service to call multple stored procedure in each method
能否请您帮助我并提供任何示例或场景,在这些示例或场景中,我可以使用来自 Web 服务操作的流程来调用数据库调用。如果我的 Web 服务实现有五个操作并且每个操作都必须调用单独的查询或存储过程。
我有另一种方法,通过使用 spring 注入来注入数据库模板并调用所需的查询或存储过程,但我想使用流程来完成。
看看CXF代理服务:https://docs.mulesoft.com/mule-user-guide/v/3.7/proxying-web-services-with-cxf
它允许访问原始 SOAP 消息并按您希望的方式路由它,例如使用在操作名称上使用 Xpath 的选择路由器,或者您可以提取 SOAPAction header 等。
<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>
能否请您帮助我并提供任何示例或场景,在这些示例或场景中,我可以使用来自 Web 服务操作的流程来调用数据库调用。如果我的 Web 服务实现有五个操作并且每个操作都必须调用单独的查询或存储过程。
我有另一种方法,通过使用 spring 注入来注入数据库模板并调用所需的查询或存储过程,但我想使用流程来完成。
看看CXF代理服务:https://docs.mulesoft.com/mule-user-guide/v/3.7/proxying-web-services-with-cxf
它允许访问原始 SOAP 消息并按您希望的方式路由它,例如使用在操作名称上使用 Xpath 的选择路由器,或者您可以提取 SOAPAction header 等。
<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>