Forum Discussion
richie
Community Hero
Hey DavidSEM_Admin,
If youre running ReadyAPI!, you could create an event handler to strip out the empty elements after the data has been extracted from your source but before its injected via your REST request, so you wouldnt have to build the xml using groovy.
For the event handler groovy youd just need to identify the xpath of the attributes you want stripped.
Ta
Rich
If youre running ReadyAPI!, you could create an event handler to strip out the empty elements after the data has been extracted from your source but before its injected via your REST request, so you wouldnt have to build the xml using groovy.
For the event handler groovy youd just need to identify the xpath of the attributes you want stripped.
Ta
Rich
DavidSEM_Admin
4 years agoOccasional Contributor
HI richie
Thank you for your answer. Could you explain a little more about your idea with the event handler? I am using ReadyAPI 3.3.1.
I did an event handler with the mentioned script in my previous messages in this topic. I did an event "RequestFilter.filterRequest" and it didn't work. What went wrong?
This was the script:
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
def stepName = context.getCurrentStep().getLabel()
def holder = groovyUtils.getXmlHolder(stepName + "#Request")
for( item in holder.getDomNodes( "//*[. = '']" )){
holder.removeDomNodes("//"+item.nodeName)
}
Related Content
- 3 years agomrarkapravo
Recent Discussions
- 17 hours agoKLWallace
- 7 days agoruchisingh