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.
November 22, 2008, 01:50:50 pm
Username: Password:
Login with username, password and session length

Forgot your password?
 
getting a value from soap response
Welcome, Guest. Please login or register.
November 22, 2008, 01:50:50 pm
Home Help Search Login Register
News: The Forums are up! Welcome to eviware.

+  Eviware Forum
|-+  soapUI
| |-+  soapUI
| | |-+  getting a value from soap response
« previous next »
Pages: [1] Print
Author Topic: getting a value from soap response  (Read 672 times)
Franky
soapui pro users
Newbie
*
Posts: 17


« on: July 24, 2007, 07:34:28 am »

hi all,

how to retrieve value from soap response.?

suppose i got a response of:
<Table>
    <Town>Bayham Abbey</Town>
    <County>Kent</County>
    <PostCode>TN3</PostCode>
  </Table>
<Table>
    <Town>Bolton Abbey</Town>
    <County>North Yorkshire</County>
    <PostCode>BD23</PostCode>
  </Table>
  <Table>
    <Town>Lesnes Abbey</Town>
    <County>Greater London</County>
    <PostCode>SE2</PostCode>
  </Table>


i need to retrieve PostCode values.

thanks
franky
Logged
omatzura
Administrator
Hero Member
*****
Posts: 1,425


« Reply #1 on: July 24, 2007, 08:57:28 am »

Hi Franky,

create a groovy-script step after your request that gets the response message and parses it using any of the available XML-parsing options in groovy (http://groovy.codehaus.org/Processing+XML)..  for example:

Code:
// get request property
def request = testRunner.testCase.getTestStepByName( "Request 1" )
def property = request.getProperty( "request" )

// parse out textnodes to modify
def node = new groovy.util.XmlParser(false,false).parseText(property.value)
...

Hope this helps!

regards,

/Ole
eviware.com
Logged
Franky
soapui pro users
Newbie
*
Posts: 17


« Reply #2 on: July 24, 2007, 10:36:04 am »

hi ole

thanks for the response . i have gone through the link that u have sent...

since i am a newbie user, i dont know where to insert the groovy script and get a value from the response.could u plz explain in detail

thanks
franky


Logged
Franky
soapui pro users
Newbie
*
Posts: 17


« Reply #3 on: July 25, 2007, 07:43:02 am »

Hi ole,

Since i am a Novice user for Groovy and its usage, Kindly shed some Light On this.

Thanks,
Franky
Logged
nreimertz
Administrator
Full Member
*****
Posts: 205


« Reply #4 on: July 26, 2007, 10:35:01 am »

Hi!

If you right click in the TestCase editor or right click in the project tree on a TestCase (it usually says Test Steps ()) you will be able to choose Add Step/Groovy Script.

You can read mote about how to use Groovy Scripts at:

http://www.soapui.org/userguide/functional/groovystep.html

And about how to work with TestCases at

http://www.soapui.org/userguide/functional/testcases.html.

Hope this helps!

/niclas
eiware.com
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