1
votes

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
What do you mean by "Mule soap component"? Is it a cxf:jaxws-client? - David Dossot
Yes, exactly. I want to change the cxf:jaxws-client operation attribute at runtime since we're 3 different operations from the same service. - techRunner

1 Answers

2
votes

To achieve your goal:

  • Remove the operation attribute from the cxf: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.