Forum Discussion

Sachin_Sawe's avatar
Sachin_Sawe
Contributor
16 years ago

Inserting/Creating new node using Property Transfer?

Ole,

We know how to create / insert / modify nodes in target xml using groovy. However, how do we do that using property transfer? For example, say, you have a request


ABCD


the response of this request is



  1234
  ABC Corp
  blah blah
 
    30.00
 


  ...
  ...
  ...


now there is a request to buy this book say:



  1234
  ABC Corp
  blah blah
 
    30.00
   
    333-444-4444-888
 




As shown above I have a need to insert this loyaltycard element but only at the buy time request so that this purchase is tied to that particular loyaltycard in order to gain points on the card for this particular purchase.

Again, I know various ways this can be done using groovy scripting. What I am looking for is some way of NOT USING GROOVY SCRIPTING but using any SOAPUI PRO GUI features that would allow me to insert that optional xml element in the buy request.

Also remember my flow of test steps is

1. Run bookSearch SOAP Request
2. Transfer results of search request to buyBook Request.

so it would not help just hard coding the xml element in buyBook Request as I DO NEED TO pull stuff from results of book search and then put it in buyBook request. It is only after I populate buyBook request with results of search that I need to insert this optional node under 'price' element.

please let me know if this is possible. If so, how?

Regards,
Sachin

9 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    hmm.. where are you getting the loyalty card value? Stored in a property somewhere? Or from a previous response?

    regards,

    /Ole
    eviware.com
  • Nevermind, Ole. I figured it out myself. I have also posted it on my blog. Feel free to pass it on in case any one comes across similar problem. Here it is

    http://onebyteatatime.wordpress.com/

    I hope to post some more of tips n tricks on soapUI on my blog soon.

    Regards,
    Sachin
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Sachin,

    way cool solution! I'll check if the XQuery processor we are using (Saxon 9) supports dynamic insert/updates in which case we can add support for this as well.

    regards!

    /Ole
    eviware.com
  • oh, that will be cool. then we can achieve this functionality in two lines of code.

    Thanks, Ole.

    Sachin
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Sachin,

    the Saxon 9.1 release has support for XQuery updates, so eventually this will be in soapUI as well.. keep your eyes open :-)

    regards,

    /Ole
    eviware.com