Using Expression Language in Webservice Connector

I recently realized webservice connector supports expressions. ( Using Expression Language )

I have a use case where I have to split the value by “:” and pass the 1st part in URL and 2nd part in body. I can easily do it using rules but just exploring if I can achieve it OOTB.

I have tried this: _#$plan.role$.substring(0, $plan.role$.indexOf(‘:’))_#

but it gave me “_ “

Any insights on this would be a great help

@gourab -
You used

_#$plan.role$.substring(0, $plan.role$.indexOf(':'))_#

The problem is this bit:

$plan.role$.indexOf(':')

If you look at the Web Services expression language docs, the only string methods it supports are:

  1. concat
  2. length
  3. toUpperCase
  4. toLowerCase
  5. replace
  6. substring

There’s no indexOf (and no split) in that list. The EL here is not full Java String; it’s a very small, whitelisted subset.

Hope this clarifies your doubt why it didn’t work for you.

2 Likes

@gourab -

Do you still need any help?
If not, please mark it as solved.

Thanks for your cooperation.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.