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.
January 09, 2009, 07:49:36 am
Username: Password:
Login with username, password and session length

Forgot your password?
 
setNodeValue in Request
Welcome, Guest. Please login or register.
January 09, 2009, 07:49:36 am
Home Help Search Login Register
News: The Forums are up! Welcome to eviware.

+  Eviware Forum
|-+  soapUI
| |-+  soapUI
| | |-+  setNodeValue in Request
« previous next »
Pages: [1] Print
Author Topic: setNodeValue in Request  (Read 384 times)
CCantrell
soapui pro users
Newbie
*
Posts: 1


« on: July 16, 2008, 09:07:47 pm »

Based on the following code from the Help documentation

  def groovyUtils =
     new com.eviware.soapui.support.GroovyUtils( context )
  holder =
     groovyUtils.getXmlHolder( "Book Author Search#Request" )
  holder.setNodeValue( "//ns:SubscriptionId", ""+Math.random() )

I programmed the following groovy script:

  groovyUtils =
     new com.eviware.soapui.support.GroovyUtils( context );
  holder =
     groovyUtils.getXmlHolder("retrieveProduct#Request");
  holder.setNodeValue( "//v1:retrieveProduct/arg0", 2 );

where the Request node has the following content:

<soapenv:Envelope 
  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:v1="http://v1.ui.api.contract.svc.plad.ontsys.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <v1:retrieveProduct><arg0>1</arg0></v1:retrieveProduct>
   </soapenv:Body>
</soapenv:Envelope>

However, when the script executes, I get the following error:

groovy.lang.MissingMethodException: No signature of method:
  com.eviware.soapui.support.XmlHolder.setNodeValue() is applicable
  for argument types: (java.lang.String, java.lang.Integer) values:
  {"//v1:retrieveProduct/arg0", 2}

Can someone explain why my code, which closely models the example code,  generates this error? I am able to successfully get the node value from the request. I am only unable to set it. Thanks.


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


« Reply #1 on: July 17, 2008, 10:15:29 am »

Hi,

the setNodeValue expects two string arguments, please try

holder.setNodeValue( "//v1:retrieveProduct/arg0", "2" )

or

holder["//v1:retrieveProduct/arg0"] = "2"

instead.

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