This example demonstrate the usage of content modifier step, to set and get header, property and body. IFlow consist of 2 content modifier steps and log01, log02 script steps.

Click on any blank area in iflow, then set the namespace like below. Set the namespace same like namespace in WSDL file.

The sender soap channel is using another “PC.WSDL”. See the PC’s xml schema structure and example xml message in SOAPUI at the end of this post.

PC.wsdl

The script is reusing existing script like previous Post, but added “logging” checking if value equal to ‘true’:
If logging set to ‘true’, then only header, property logging and payload attachment will happen during runtime.

First content modifier:
Header:
Set header.price with XPath
Set header.title with Constant value
Set header.logging with External Parameter

For XPath, after namespace set correctly, able to choose from dropdown list:

Steps to set External parameter: Go to tab “Externalized Parameters”, set the value, then click save icon and right side.

Property:
Set property.msg with expression build-in ${in.body}
Set property.footer with Constant value.

Body: is remain default without set anything.

Second content modifier:
Header:
Set header.logging_copy by reusing value from header.logging.

Property:
Set property.footer_copy by reusing value from property.footer.

Body: Read all header, property set in 1st and 2nd content modifier step, then set them in body combine with xml structure below:

Input and Output result using SOAPUI:

In my view, Content Modifier is very useful for variable-like setting/getting tasks, and provide a very flexible way to manually set the output body using WYSIWYG way, very intuitive. However for programmatically read and set output payload, other steps like Mapping or Scripting is better option.

Content Modifier to Get Input/Set Output using Type Constant, XPath, Expression, Header, Property and Externalized Parameters
Tagged on:             

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.