问题
In my flow I have a soap client calling a service. Since we are using 3 different operations from the service I'd like to dynamically fill in the "Operation" field under "Client Attributes" in Mule soap component. The way I have it working right now is:
start flow -> message transformation -> choice flow control (based on the message type)
choice 1. sub flow A -> soap client with operation A
choice 2. sub flow B -> soap client with operation B
choice 3. sub flow C -> soap client with operation C
What I would like is to dynamically in runtime set the "Operation" field based on the message and not have three different subflows.
start flow -> message transformation -> set the operation field -> soap client with the correct operation
Is that possible? Using Mule CE 3.3.1. Thanks in advance.
回答1:
To achieve your goal:
- Remove the
operation
attribute from thecxf:jaxws-client
element, Add set the operation as an outbound message property before the
cxf:jaxws-client
element with:<set-property propertyName="operation" value="#[...]" />
where
#[...]
represents a MEL expression that extracts the operation name from the message.
来源:https://stackoverflow.com/questions/15533402/mule-dynamically-setting-soap-operation