简体   繁体   中英

How to add xml String into a request on Soapui groovyscript?

I have a string XML like this one :

<glossary>
   <GlossDiv>
      <GlossList>
         <GlossEntry>
            <Abbrev>ISO 8879:1986</Abbrev>
            <Acronym>SGML</Acronym>
            <GlossDef>
               <GlossSeeAlso>
                  <e>GML</e>
                  <e>XML</e>
               </GlossSeeAlso>
               <para>A meta-markup language, used to create markup languages such as DocBook.</para>
            </GlossDef>
            <GlossSee>markup</GlossSee>
            <GlossTerm>Standard Generalized Markup Language</GlossTerm>
            <ID>SGML</ID>
            <SortAs>SGML</SortAs>
         </GlossEntry>
      </GlossList>
      <title>S</title>
   </GlossDiv>
   <title>example glossary</title>
</glossary>

How Could I add this to a XML request I have?

For example:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.webserviceX.NET">
   <soapenv:Header/>
   <soapenv:Body>
      <web:GetWeather>
            <HERE IS WHERE I'D LIKE TO PUT MY XML FROM BEFORE>
      </web:GetWeather>
   </soapenv:Body>
</soapenv:Envelope>

Thank you in advance guys. any help would be great.

This is the way you can modify the value of the request on soapUI by using Groovy Script.

testRunner.testCase.testSteps["yournameRequest"].setPropertyValue("Request","newvalueyouwanttoUse")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM