messageExchange not recognised
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2010
11:05 AM
04-24-2010
11:05 AM
messageExchange not recognised
def holder = groovyUtils.getXmlHolder( messageExchange.responseContent );
When I try to execute this script , I get this pop up which says groovy.lang.MissingPropertyException:No such property:messageExchange for class: Script35
Please find the screenshot of the pop up attached.
I desperately need this to work ,where am I making a mistake?
When I try to execute this script , I get this pop up which says groovy.lang.MissingPropertyException:No such property:messageExchange for class: Script35
Please find the screenshot of the pop up attached.
I desperately need this to work ,where am I making a mistake?
6 REPLIES 6
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2010
09:38 PM
04-27-2010
09:38 PM
I expect that the MessageExchange context is not available to you in the script. You will have to get the response from the request directly.
def holder = groovyUtils.getXmlHolder(testRunner.testCase.testSteps["XXXStepName"].testRequest.response.getContentAsXml());
should work.
def holder = groovyUtils.getXmlHolder(testRunner.testCase.testSteps["XXXStepName"].testRequest.response.getContentAsXml());
should work.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2010
10:48 PM
04-27-2010
10:48 PM
hi There,
Thanks a lot for the reply, your code does work, however, I would like to use the messageExchange for the same purpose.
Below is the code which I use :
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def holder = groovyUtils.getXmlHolder(messageExchange.responseContent)
I am creating context ,but still i get the same error.Do you know any possible reason for this.I am using soapui pro 3.5
Thanks a lot for the reply, your code does work, however, I would like to use the messageExchange for the same purpose.
Below is the code which I use :
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def holder = groovyUtils.getXmlHolder(messageExchange.responseContent)
I am creating context ,but still i get the same error.Do you know any possible reason for this.I am using soapui pro 3.5
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2010
05:27 PM
04-29-2010
05:27 PM
Hi!
exactly where in soapUI are you running this script?
regards!
/ole
eviware.com
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
exactly where in soapUI are you running this script?
regards!
/ole
eviware.com
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2010
12:28 AM
05-05-2010
12:28 AM
Hi
So sorry for the late reply on this.
I am running this in a test suite, in a groovy step.
So sorry for the late reply on this.
I am running this in a test suite, in a groovy step.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2016
03:59 AM
09-14-2016
03:59 AM
Hi There,
I believe, 'messageExchange' is works only in Script Assertion. Your purpose can be solved by context.expand().
Thanks,
Chinmay
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2017
01:22 PM
07-07-2017
01:22 PM
The syntax is valid, assuming you are running it in Script Assertion.
Moreover, please make sure your response is in xml format. Some api may sometimes return both json or xml if you does not specifically specify what you accept.
To make sure your response is accepting an xml, adding an Accept header in your request will help.
