aspose file tools*
The moose likes Groovy and the fly likes Parsing XML in Groovy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Parsing XML in Groovy" Watch "Parsing XML in Groovy" New topic
Author

Parsing XML in Groovy

Susanta kumar Sahani
Greenhorn

Joined: May 24, 2012
Posts: 2
Hi,

I am doing an automation on SOAP UI. I am biginer to groovy, Can you please help me how to read the xml tags in groovy. I want to read the response of my webservices, if the status is "Failure" then I need to print the error description passed in the string.
Please help me on this..
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

Susanta kumar Sahani wrote:
I am doing an automation on SOAP UI. I am biginer to groovy, Can you please help me how to read the xml tags in groovy. I want to read the response of my webservices, if the status is "Failure" then I need to print the error description passed in the string.
Please help me on this..


Did you have a look at the XmlSlurper API of Groovy which can be used to read the XML data.


Mohamed Sanaulla | My Blog
Susanta kumar Sahani
Greenhorn

Joined: May 24, 2012
Posts: 2
Mohamed Sanaulla wrote:
Susanta kumar Sahani wrote:
I am doing an automation on SOAP UI. I am biginer to groovy, Can you please help me how to read the xml tags in groovy. I want to read the response of my webservices, if the status is "Failure" then I need to print the error description passed in the string.
Please help me on this..


Did you have a look at the XmlSlurper API of Groovy which can be used to read the XML data.


Hi, I checked with that..but can not come to the solution..Can you please provide a pice of code for the same...
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

Susanta kumar Sahani wrote:
Mohamed Sanaulla wrote:
Susanta kumar Sahani wrote:
I am doing an automation on SOAP UI. I am biginer to groovy, Can you please help me how to read the xml tags in groovy. I want to read the response of my webservices, if the status is "Failure" then I need to print the error description passed in the string.
Please help me on this..


Did you have a look at the XmlSlurper API of Groovy which can be used to read the XML data.


Hi, I checked with that..but can not come to the solution..Can you please provide a pice of code for the same...

The API provides a sample code. At JavaRanch we promote learning and not just feeding with readymade solutions. Please put in some effort to learn the same.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Parsing XML in Groovy