title: SOAPUI: Modify Request: Groovy: appendNode applicable arguments
body: <p>I'm trying to modify a SOAP Request by adding a duplicate child node with different value.</p>
  
  <p>This is what I have so far:</p>
  
  <p>Request:</p>
  
  <pre><code>&lt;soapenv:Envelope xlmns:ns1 = "..." xlmns:ns2 = "..." xlmns:ns3 = "..." xlmns:ns4 = "..."&gt;
     &lt;soapenv:Body&gt;
         &lt;ns2:OperationName&gt;
            &lt;ns3:CuteN&gt;77777&lt;/ns3:CuteN&gt;
            &lt;ns3:RaveN&gt;666&lt;/ns3:RaveN&gt;
         &lt;/ns2:OperationName&gt;
     &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>Request to be modified as: (fill the xml tags &amp; add another tag <code>&lt;RaveN&gt;&lt;/RaveN&gt;</code> with a value)</p>
  
  <pre><code>&lt;soapenv:Envelope xlmns:ns1 = "..." xlmns:ns2 = "..." xlmns:ns3 = "..." xlmns:ns4 = "..."&gt;
     &lt;soapenv:Body&gt;
         &lt;ns2:OperationName&gt;
            &lt;ns3:CuteN&gt;77777&lt;/ns3:CuteN&gt;
            &lt;ns3:RaveN&gt;666&lt;/ns3:RaveN&gt;
            &lt;ns3:RaveN&gt;888&lt;/ns3:RaveN&gt;
         &lt;/ns2:OperationName&gt;
      &lt;/soapenv:Body&gt;
   &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>Code used:</p>
  
  <pre><code>/* Groovy Utilities Declaration */
  def groovyUtils = new ns4.eviware.soapui.support.GroovyUtils(context)
  
  /* Request Holder Setup */
  def request      = context.expand('${RequestStepName#Request}')
  def requestHolder    = groovyUtils.getXmlHolder("request")
  
  /* Declaring Namespaces */
  requestHolder.namespaces["soapenv"] = "http://schemas.xmlsoap.org/soap/envelope/"
  requestHolder.namespaces["ns2"]     = "..."
  requestHolder.namespaces["ns3"]     = "..."
  requestHolder.namespaces["ns4"]     = "..."
  
  /* Set few string names */
  def soapEnvXString       = "//soapenv:Envelope"
  def soapBodyXString      = "/soapenv:Body"
  def operXString          = "/ns2:OperationName"
  def raveNumXString       = "/ns3:RaveNum"
  
  /* create object of Request nodes */
  def parentNode       = requestHolder.getDomNode(soapEnvXString + soapBodyXString + operXString)
  
  def reqRaveNumTwo = "888"
  
  if(reqRaveNumTwo != null &amp;&amp; reqRaveNumTwo != "")
  {
      /* create new node */   
      def secondRaveNumNode = new XmlSlurper(false,false).parseText("""&lt;ns3:RaveNum&gt;${reqRaveNumTwo}&lt;/ns3:RaveNum&gt;""")
      parentNode.appendNode(secondRaveNumNode)
  }
  
  /* Update the request holder properties */
  requestHolder.updateProperty(true)
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>groovy.lang.MissingMethodException: No signature of method: org.apache.xmlbeans.impl.store.Xobj$ElementXobj.appendNode() is applicable for argument types: (groovy.util.slurpersupport.NodeChild) values: [888]
  </code></pre>
  
  <p>I know I'm missing something here, this is my 3rd day of Groovy deep-dive. Any help will be much appreciated, Thanks in advance!</p>