Ask a Question

Extract SOAP XML attribute value from datafile to provide JDBC request with query filter value

SOLVED
richie
Community Hero

Extract SOAP XML attribute value from datafile to provide JDBC request with query filter value

Hi,

 

Its been years since I used SoapUI Pro (I was never that good with it to begin with) and I'm now using ReadyAPI! v1.9.0 and I'm struggling.

 

I have 80 test data files (XML) which will be used to populate the body of a Soap message being posted to a web service.  Within these XML files is an attribute value (RecordID) I need to source to populate the where clause of a query filter in a JDBC step.  I've followed the instructions that I've found and done various google searches, however, I'm still struggling so I'm hopeful someone can help!

 

My hierarchy is as follows:

Datasource step (Type=File, Property = FileContent, no separator, charset=UTF-8)
Soap step (body tag value = ${DataSource#FileContent})
Property Transfer step (Property=GetRecordID, Source=Datasource, Property=FileContent, PathLanguage=XPath, value=//*:RootElement/Element/@RecordID)
JDBC step (select * from table where RecordID='value I need from XML datafile')

I apologise if I'm asking a stupid question or for wasting anyone's time.

 

I do appreciate any and all guidance anyone can provide!

 

Cheers!

 

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
10 REPLIES 10
richie
Community Hero

Much thanks to go to nmrao & Radford for holding my hand until I sorted the problem.

 

I still haven't identified why it wasn't working other than copying and pasting the datasource details into the groovyscript didn't appear to pickup the Datasource's propertyname - I had to use GetData context menu before it would recognise my '${DataSource#FileContents}' property for some reason.

 

Anyway - success! so thanks again!

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
cancel
Showing results for 
Search instead for 
Did you mean: