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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 3054
    
  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: 3054
    
  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
 
Similar Threads
Rule Engine and Groovy
How to display XML data by servlet on browser ?
com.gargoylesoftware.htmlunit.ScriptException: TypeError: is not a function, it is undefined
Calling java program from groovy...
How to test web application using Groovy