Forum Discussion

MaxF12's avatar
MaxF12
New Contributor
7 years ago

[GROOVY][SoapUI] Get part of a SoapResponse to put it in an other Request

Hello Everybody,

I've looked for a solution to this issue but nothing worked since. I'll explain to you.

I have two methods to call to udpate an adress, the first one give me datas in the response that I need to call the second one. So I Tried the "Transfert Property" of SoapUI but, the thing is that put prefixes in the nodes that I've got from the response.

And the server can't handle prefixes in the second request for this datas. I tried to parse with XMLParser but same issue, prefixes...

So I've found that getting the nodes and their childs as text and put them as a string in a test case property will work as I need but I don't know which groovy methods I need. :'(

I want to get the XML structure and content defined in the "WhatIWantAsText" node,

Thanks for your Help ;)

 

Hello Everybody,

I've looked for a solution to this issue but nothing worked since. I'll explain to you.

I have two methods to call to udpate an adress, the first one give me datas in the response that I  need to call the second one. So I Tried the "Transfert Property" of SoapUI but, the thing is that put prefixes in the nodes that I've got from the response. 

And the server can't handle prefixes in the second request for this datas. I tried to parse with XMLParser but same issue, prefixes...

So I've found that getting the nodes and their childs as text and put them as a string in a test case property will work as I need but I don't know which groovy methods I need. :'(

I want to get the XML structure and content defined in the "WhatIWantAsText" node, 

Thanks for your Help ;)


    <Enveloppe>
      <Node1>My Node1</Node1>
      <Node2>
         <Node3>Node3</Node3>
         <Node4>Node4</Node4>
         <WhatIWantAsText>
             <Child1>Child1</Child1>
             <Child2>
               <Child3>Child 3</Child3>
               <Child4>
                   <Child5>Child5</Child5>
                   <Child6>
                      <Child7>Child7</Child7>
                    </Child6>
                    <Child8>Child8</Child8>
              </Child2>
        </WhatIWantAsText>
      </Node2>
      <Node5>Node5</Node5>      
    </Enveloppe>
  • nmrao's avatar
    nmrao
    Champion Level 3
    Can you specify the input xml and desired output xml please?
    • MaxF12's avatar
      MaxF12
      New Contributor

      Hi nmrao thanks again for your help,

       

      I want to get all the structure and datas found in the protag node of the response file, I need to put this in a test case property to avoid prefixes, this property will be used in the request file.

       

      Tell me if you need more info, 

       

      Max,

  • MaxF12's avatar
    MaxF12
    New Contributor

    Hi nmrao,

     

    Here are the files you requested. I want to get all the content of the <PROTAG> node in the response, to put in the <clas: protag> node in the request. The thing is, that if I use transfert property to fill the request, I'll get clas: prefixes in front of any node I tranferred so my server can't read the datas.

     

    I tried to put xml nodes in a TestCaseProperty that I put in the <clas: protag> in my request and SoapUI didn't put any prefixes in front of it. 

     

    So that's what I'm lookin for, getting all the protag content in the response as text to fill the property.

     

    Thanks again for your help,

  • MaxF12's avatar
    MaxF12
    New Contributor

    I'm still struggling on that issue. Nobody has a solution ? :/