[WSO2 ESB] Check if the SOAP body is blank

There might be a time where you need to check if the SOAP body sent going through the WSO2 ESB is actually blank. Here is how you can check that.

We use the Filter mediator [1] to filter out the SOAP body through XPATH [2].

How to check the SOAP Body is blank through XPATH

you can use the following to get check if the XPATH is blank. By using the XPATH boolean function you can check the following

boolean(//soapenv:Body/*[1])

function boolean()

  • a number is true if and only if it is neither positive or negative zero nor NaN
  • a node-set is true if and only if it is non-empty
  • a string is true if and only if its length is non-zero
  • an object of a type other than the four basic types is converted to a boolean in a way that is dependent on that type

[1] http://docs.wso2.org/display/ESB460/Filter+Mediator
[2] http://www.w3.org/TR/xpath/#function-boolean


3 Replies to “[WSO2 ESB] Check if the SOAP body is blank”

  1. Pingback: Google
  2. Pingback: Google

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.