header
header
Main Menu
Home
Eviware Store
Downloads
Products
News
Forum
Eviware Blog
Search
FAQs
Customer Area
Support
Documentation
Tutorials
CookBook
Downloads
Forum
Login Form
Welcome, Guest. Please login or register.
December 01, 2008, 06:38:10 pm
Username: Password:
Login with username, password and session length

Forgot your password?
 
groovy utils - modify response
Welcome, Guest. Please login or register.
December 01, 2008, 06:38:10 pm
Home Help Search Login Register
News: The Forums are up! Welcome to eviware.

+  Eviware Forum
|-+  soapUI
| |-+  soapUI
| | |-+  groovy utils - modify response
« previous next »
Pages: [1] Print
Author Topic: groovy utils - modify response  (Read 1014 times)
Javier
Newbie
*
Posts: 8


« on: July 03, 2007, 09:25:57 am »

hello!!
 
i have a method 'void' with this fault response:
 
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Body>
<soap:Fault>
<soap:Code>
<soap:Value>?</soap:Value>
</soap:Code>
<soap:Reason>
<!--1 or more repetitions:-->
<soap:Text xml:lang="?">?</soap:Text>
</soap:Reason>
</soap:Fault>
</soap:Body>
</soap:Envelope>
 
the next step is modify the values with the groovy utils ( script ) because i want to use "mappers" from values to property file ( propertyTransfer ).
 
the script is:
 
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context );
log.info( groovyUtils.projectPath );
 
// create holder for last response  
def holder = groovyUtils.getXmlHolder( "write - Request#Response" )
holder.setNodeValue( "soap:Envelope/soap:Body/soap:Fault/soap:Code/soap:Value", "1" );
 
// update request with updated xml
groovyUtils.setPropertyValue( "write - Request", "Response", holder.prettyXml );
 
this is ok...but the values of the property has this values: "?"   Huh
 
how I could resolve it?
 
thanx alot!!
Logged
omatzura
Administrator
Hero Member
*****
Posts: 1,466


« Reply #1 on: July 03, 2007, 09:34:16 am »

Hi,

thanks for reposting :-)

The Response property is read-only, so you won't be able to set the updated response.. but you can check that the update went ok with

log.info( holder.prettyXml )

What exactly do you want to do? Maybe there is some other way I can help you with!?

regards,

/Ole
eviware.com
Logged
Javier
Newbie
*
Posts: 8


« Reply #2 on: July 03, 2007, 11:15:26 am »

My "problem" is the void method: write ... i can't edit the response .. adding groovy script

one idea .... use 'PropertyTransfer' ..  transfer the data from response to porperty ... edit the values "?" by another ones using groovy utils...but it doesn't work.

do you have another idea??

again...thanx alot!!!

Logged
omatzura
Administrator
Hero Member
*****
Posts: 1,466


« Reply #3 on: July 03, 2007, 12:59:32 pm »

Hi again,

I'm not really sure of your use-case here.. as far as I understand you
1) have a request to a webservice that
2) returns an empty soap 1.2 fault message..
3) You then want to modify the fault message
4) before using a property-transfer to transfer values from it to a
5) properties-step, which you then save to a file..

is this correctly understood?

regards!

/Ole
eviware.com
Logged
Javier
Newbie
*
Posts: 8


« Reply #4 on: July 03, 2007, 01:32:18 pm »

yes...perfect!

i try to do a testsuite with several testcase like a sequence...i am passing the values from one test to other test...it is like a simulation...

thanx!!
Logged
omatzura
Administrator
Hero Member
*****
Posts: 1,466


« Reply #5 on: July 03, 2007, 02:16:03 pm »

Hi,

Try writing the modified response to a temporary property in your properties-step and then use this property as the source of your property-transfer!?

regards,

/Ole
eviware.com
Logged
Javier
Newbie
*
Posts: 8


« Reply #6 on: July 06, 2007, 09:13:38 am »

good!

another question about this Testcase. Now, if i do a submit the request and works OK, there is not a Response. Then, the testcase fail: "--> Invalid/empty response"....i don't have any assertion...

and i am not sure if it is a problem with the wsdl or the tool... Huh


Logged
omatzura
Administrator
Hero Member
*****
Posts: 1,466


« Reply #7 on: July 06, 2007, 09:32:56 am »

Hi,

you can uncheck the "abort on error" option in the TestCase options dialog, then the TestCase will continue even after a failed teststep

regards,

/Ole
eviware.com
Logged
Javier
Newbie
*
Posts: 8


« Reply #8 on: July 06, 2007, 09:48:21 am »

ahh good!!

 Cheesy
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
header header
header
header