Setting SOAP request Node value at runtime using XmlHolder in Java 1.8
<p>I am working on an automation script that uses SoapUI api classes to read a wsdl and execute it after dynamically filling data from a excel file.</p>

<p>I am using XmlHolder class to get or set Soap request Node values but I am facing issues in accessing the request XML nodes using the XPath with XmlHolder.
Following is the sample request and the code that I have tried:</p>

<p>//sample Soap request</p>

<pre><code>&lt;soapenv:Envelope     xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET/"&gt;
       &lt;soapenv:Header/&gt;
       &lt;soapenv:Body&gt;
          &lt;web:ConversionRate&gt;
             &lt;web:FromCurrency&gt;?&lt;/web:FromCurrency&gt;
             &lt;web:ToCurrency&gt;?&lt;/web:ToCurrency&gt;
          &lt;/web:ConversionRate&gt;
       &lt;/soapenv:Body&gt;
    &lt;/soapenv:Envelope&gt;

      //code
     XmlHolder xmlHolder = null;
     try {
        xmlHolder = new XmlHolder(soapOperation.createRequest(true));
        } catch (XmlException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        };

        xmlHolder.declareNamespace("web","http://www.webserviceX.NET");

        // Here tagCell.getStringCellValue() = FromCurrency

        System.out.println("FromCurrency= " + request.getNodeValue(".//web:" + tagCell.getStringCellValue()));
        request.setNodeValue(".//web:" + tagCell.getStringCellValue() , valCell.getStringCellValue());

        //Other tried xPath
        //System.out.println("FromCurrency= " + request.getNodeValue("//web:" + tagCell.getStringCellValue()));
        //System.out.println("FromCurrency= " + request.getNodeValue("//:" + tagCell.getStringCellValue()));
        //System.out.println("FromCurrency= " + request.getNodeValue("//*:" + tagCell.getStringCellValue()));
</code></pre>

<p>Can anyone please suggest the xPath for XmlHolder.setNodeValue().</p>

<p>Also to be noted here that Soap nodes have namespace i.e; <code>&lt;web:FromCurrency&gt;</code></p>

<p>Thanks in advance</p>