Grab value within XML fragment within a single XML element (CDATA element query)?
Hey!
I'm posting a SOAP request to a web service which generates a SOAP response. The XML payload within the SOAP response is all contained within 1 tag (using a CDATA element)
Within the payload there is a unique identifier that I need to transfer to a subsequent JDBC test step as the filter in the query - see as follows:
Datasource (directory type) with fileContents property SOAP request (sourcing the fileContents property as the payload of the request) <-- need to do a PROPERTY TRANSFER on a specific value in the payload JDBC Test Step (using the uniqueID from the SOAP response)
When I've done this before - the response wasn't in a SOAP wrapper - so all the tags/attributes within the Response's XML were on different lines in the Response - so it was straightforward to do a PROPERTY TRANSFER on to transfer the uniqueID from the response.
HOWEVER - because all the payload of the XML response is contained within a single SOAP payload tag (using the CDATA element) - I'm struggling to extract the uniqueID (SyncID in the XML below)
<SOAP-ENV:Envelope>
<SOAP-ENV:Body>
<NS1:SyncResponse>
<return><![CDATA[<SyncVenueOutput>
<Responses>
<SyncSuccesses>
<SyncSuccess SyncID="AB123"/>
</SyncSuccesses>
<SyncIgnores>
</SyncIgnores>
<SyncErrors>
</SyncErrors>
</Responses>
</SyncOutput>]]></return>
</NS1:SyncResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
As I say above - I need to extract the SyncID value (currently set above as 'AB123' above) to pass to the JDBC test step - but when I try the transfer - I'm transferring ALL the XML - not just the 'AB123'
I hope I've been clear,
Can anyone provide any guidance please?
Many thanks to all!
richie