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.
October 14, 2008, 03:21:13 pm
Username: Password:
Login with username, password and session length

Forgot your password?
 
need help with setNodeValue
Welcome, Guest. Please login or register.
October 14, 2008, 03:21:13 pm
Home Help Search Login Register
News: The Forums are up! Welcome to eviware.

+  Eviware Forum
|-+  General Category
| |-+  eviware general
| | |-+  need help with setNodeValue
« previous next »
Pages: [1] Print
Author Topic: need help with setNodeValue  (Read 782 times)
anu
Newbie
*
Posts: 6


« on: January 26, 2008, 03:38:25 am »

Hi,

I am new to soapui. I am trying to write a groovy script to read the data from a file and pass them as parameters to the request in the next step.

my xml in the second step is as follows

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ses="http://xyz.com/klm/session">
   <soapenv:Header/>
   <soapenv:Body>
      <ses:open>
         <ses:company>bbb</ses:company>
         <ses:username>aa2</ses:username>
         <ses:password>2</ses:password>
         <ses:userIpAddress>10.20.30.40</ses:userIpAddress>
      </ses:open>
   </soapenv:Body>
</soapenv:Envelope>

my groovy script in the first step is as follows
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )

//create holder for last response an log requistID
def holder = groovyUtils.getXmlHolder( "ses:company#request" )

log.info holder.getNodeValue

holder.setNodeValue( "//ses:company", "ccc" )

holder.updateProperty()

This however is throwing an error
Fri Jan 25 18:37:00 PST 2008:ERROR:org.apache.xmlbeans.XmlException: error: Unexpected element: CDATA

Can you pl. help me. I do not think I am doing it right.

Logged
omatzura
soapui pro users
Hero Member
*
Posts: 1,326


« Reply #1 on: January 27, 2008, 11:52:42 am »

Hi!

is "sec:company" really the name of your Request Test Step? ie as specified in the expression for getXmlHolder in

def holder = groovyUtils.getXmlHolder( "ses:company#request" )

which maybe should be something like

def holder = groovyUtils.getXmlHolder( "Test Request 1#request" )

?

regards!

/Ole
eviware.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