Forum Discussion

v2cg4ss's avatar
v2cg4ss
New Contributor
15 years ago

Set Property from XML Response

I have the following response from my web service and I'm trying  to setup a chain of calls to the web service using the HANDLE element from this repsonse.  I'm new to soapUI and I was hoping to get an example of how to do this:


 
     
        <?xml version='1.0' encoding='UTF-8'?><br /><DMDFOAAT REPLY='LOGIN' CODE='0' MESSAGE='OK'><br /><HANDLE>000002E80FAC9870000201680170016C</HANDLE><br /><MATCHING>INCREMENTAL</MATCHING><br /><GEOCODING>ANCHOR</GEOCODING><br /><PROJECT><br /><CLIENT NAME='DemoDBWebApp'><br /><SUBCLIENT NAME='CompanyZ'><br /><JOB NUMBER='20011201b'><br /><TYPE>INCREMENTAL</TYPE><br /><DESCRIPTION>For demonstration purpose only</DESCRIPTION><br /></JOB><br /></SUBCLIENT><br /></CLIENT><br /></PROJECT><br /></DMDFOAAT>
     

 

8 Replies

  • BenX's avatar
    BenX
    Contributor
    Why are responses returning:

    <<br />and<br />


    Is there any chance to remove this from reponse before it's saved by SoapUI?
  • BenX's avatar
    BenX
    Contributor
    Does this mean that i can remove

    <<br />and<br />

    from response and then show it?
    In real time, not with some script later?
    The problem is that those 2 things prevent SoapUI to show correct response in Outline and Overview mode.

    If yes, can you be a bit more specific how to di it?

    Thanks!
  • BenX's avatar
    BenX
    Contributor
    Man... I'm spending hours on this one and no success. 
    I'll paste my project if someone from you guys can take a look.
    I would appreciate a lot.
    Thanks!

    Beno
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    the problem is that the actual payload of the message is wrapped in a CDATA, which means that it is essentially returned as a string, not XML, which is the reason the outline/overview editors show it as such. If you want to extract something from the XML in this string you will first have to extract the string (as the value of the return element) and then parse that string as XML to which you can apply xpath-logic to do your value extraction.

    Does that make sense? Is it ok if I use your XML as an example in a related blog-post (this comes up quite often.. )?

    let me know!

    regards,

    /Ole
    eviware.com