Forum Discussion

John_R__Brewste's avatar
John_R__Brewste
Occasional Contributor
16 years ago

Inserting XML

I apologize ahead of time for being new to XML and SoapUI and for not using the correct terminology.

However, I am trying to do the following from an Groovy Script.

1 - Read a Response and Grap all the information between a tag. (for example everything between ...

2 - REMOVE everthing between a tag (ie ... in a different Request and then STUFF everhting I got in step 1) and put it into the now empty of Step 2.

I just don't know where to start with that.  I have looked thru Groovy and SoapUI and tried a few things using XmlParser and XmlHolder, but not getting it done.

Thanks for any help.
--Jb

2 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi John,

    Maybe you can achieve this without a groovy script;

    1) Create a property-transfer that selects the addresses element and transfers it to a property in a properties-step, for example named "addresses"
    2) Expand that property in your request with

    ${PropertiesStep#addresses}

    In this setup the addresses will first be copied to the property, and then inserted into the outgoing request..

    Does that suffice?

    regards!

    /Ole
    eviware.com
  • John_R__Brewste's avatar
    John_R__Brewste
    Occasional Contributor
    I tried this.  However, what was happening was I was getting one parent tag too many (Only wanted the children) and I was blowing away the Parent node where I was trying to put it.  I wanted the children to go into the parent of the resulting doc without the parent of the requesting doc.  If that makes sense.

    for example:
    What I had










    What I wanted in the END: