crislawrence
16 years agoNew Contributor
Trying to parse a Salesforce login response using groovy in SoapUI 3.5
I need to extract the serverUrl and sessionId from the response I get from a Salesforce login request using a Saleforce developer setup. The response comes back just fine and looks like this:
<metadataserverurl>https://na7-api.salesforce.com/services ... 000000KYuL
false
false
https://na7-api.salesforce.com/services ... 000000KYuL
00DA0000000KYuL!ARgAQDutrkJyY4HK73.HsH6sosqaMSMtOk6pSFL2fnhIWYTpUD0xAGRjUxKtlGQ50RxVf15g0FEk2NTmhOotmeBFgZVYL42z
005A0000000RfaYIAS
false
$
USD
false
false
00DA0000000KYuLMAW
false
Villanova University
00eA0000000nzgpIAA
cris.lawrence@villanova.edu
Cris Lawrence
005A0000000RfaYIAS
en_US
en_US
cris.lawrence@verizon.net
America/Los_Angeles
Standard
Theme2
log.info("Login Response")
groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
holder = groovyUtils.getXmlHolder("Test Request#Response" )
log.info("Response: " + holder.xml)
serverUrl = holder.getNodeValue( "//serverUrl" )
assert serverUrl != null
The assert fails although the holder.xml string does show the entire xml response. Any node I substitute for 'serverUrl' in the xpath gives me the same result. Any reason why this doesn't work? Is there another way for me to get my data without resorting searching the string?
Thanks for any and all help.
- Cris
<metadataserverurl>https://na7-api.salesforce.com/services ... 000000KYuL
log.info("Login Response")
groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
holder = groovyUtils.getXmlHolder("Test Request#Response" )
log.info("Response: " + holder.xml)
serverUrl = holder.getNodeValue( "//serverUrl" )
assert serverUrl != null
The assert fails although the holder.xml string does show the entire xml response. Any node I substitute for 'serverUrl' in the xpath gives me the same result. Any reason why this doesn't work? Is there another way for me to get my data without resorting searching the string?
Thanks for any and all help.
- Cris