1
votes

I have a wsdl consisting of several operations. I have created a proxy service using that wsdl and want to expose the operations in present in the wsdl.

Can we define operation specific flow in the proxy services?

To be more precise, In Oracle Service Bus, it has the concept of branching, can we implement the same in WSO2 esb proxy?

1

1 Answers

1
votes

You can use filter or switch mediator to apply a mediation depending on the operation : look at the first node in the SOAP Body or at the SOAP Action if initialized.

Samples based on the message content (assuming this is a SOAP 11 message) :

<switch xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" source="local-name(soap:Body/*[1])">
  <case regex="operation1">
    <log level="custom">
      <property name="operation" value="operation1"/>
    </log>
  </case>
  <case regex="operation2">
    <log level="custom">
      <property name="operation" value="operation2"/>
    </log>
  </case>
  <default/>
</switch>

<filter xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" source="local-name(soap:Body/*[1])" regex="postCustomer">
  <then>
    <log level="custom">
      <property name="operation" value="operation1"/>
    </log>
  </then>
  <else>
    <log level="custom">
      <property name="operation" value="not operation1"/>
    </log>
  </else>
</filter>