Thanks it worked but I need one more help.
I need to get the entire xml from the <phone number> tag to </phone number> as there are two occurences for them.
i used the below script.
def response = groovyUtils.getXmlHolder("Operation#Response");
response.namespaces["ns1"] = "http://moneygram.com/core/service/OrchestrateGetUCP1705";
for (int y=0;y<count;y++)
{
def i2 = response["//*/consumerProfile/phoneNumber["+y+"]"];
log.info i2;
}
i used the below as well and didnt work.
def g = context.expand('${Operation#Response#//*//consumerProfile/phoneNumber["+y+"]}');
XML:
<phoneNumber>
<countryDialInNumber>1</countryDialInNumber>
<mobileFlag>true</mobileFlag>
<phoneNumber>5128797895</phoneNumber>
<startDate>2018-10-19T21:10:52-05:00</startDate>
<stronglyAuthenticated>false</stronglyAuthenticated>
<type>PRM</type>
<notificationPreference>
<method>SMS</method>
<optIn>false</optIn>
<preferredLanguage>en-US</preferredLanguage>
<startDate>2018-10-19T21:10:52-05:00</startDate>
<stronglyAuthenticated>false</stronglyAuthenticated>
<type>TXNN</type>
</notificationPreference>
<notificationPreference>
<method>SMS</method>
<optIn>true</optIn>
<preferredLanguage>en-US</preferredLanguage>
<startDate>2018-10-19T21:10:52-05:00</startDate>
<stronglyAuthenticated>false</stronglyAuthenticated>
<type>MKTN</type>
</notificationPreference>
</phoneNumber>
<phoneNumber>
<countryDialInNumber>1</countryDialInNumber>
<mobileFlag>true</mobileFlag>
<phoneNumber>6124045907</phoneNumber>
<startDate>2018-10-19T21:10:52-05:00</startDate>
<stronglyAuthenticated>false</stronglyAuthenticated>
<type>SEC</type>
<notificationPreference>
<method>SMS</method>
<optIn>false</optIn>
<preferredLanguage>en-US</preferredLanguage>
<startDate>2018-10-19T21:10:52-05:00</startDate>
<stronglyAuthenticated>false</stronglyAuthenticated>
<type>MKTN</type>
</notificationPreference>
<notificationPreference>
<method>SMS</method>
<optIn>false</optIn>
<preferredLanguage>en-US</preferredLanguage>
<startDate>2018-10-19T21:10:52-05:00</startDate>
<stronglyAuthenticated>false</stronglyAuthenticated>
<type>TXNN</type>
</notificationPreference>
</phoneNumber>