1

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.

techRunner
  • 209
  • 1
  • 5
  • 17

1 Answers1

2

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.

David Dossot
  • 33,403
  • 4
  • 38
  • 72
  • Thanks David, works like a charm. I set the an operation property in the header based on the message type and then, as you recommended, extracted with MEL the operation value and set it as follows: '' Now I only have one subflow that does all three operations, perfect, thanks again. – techRunner Mar 29 '13 at 21:33
  • Glad it works! Suggestion: use MEL instead of the old style / deprecated expression syntax, ie: `` – David Dossot Mar 29 '13 at 21:44
  • Yup, good suggestion. I will change it and test it out. Thank you. – techRunner Mar 30 '13 at 15:50