File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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: 3068
    
  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: 3068
    
  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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Parsing XML in Groovy