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 My Groovy Script Fails to Pick Up XML Element Value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Groovy
Bookmark "My Groovy Script Fails to Pick Up XML Element Value" Watch "My Groovy Script Fails to Pick Up XML Element Value" New topic
Author

My Groovy Script Fails to Pick Up XML Element Value

Natalie Kopple
Ranch Hand

Joined: May 06, 2003
Posts: 325
I have prepared a Groovy script in soapUI. Somehow, the Groovy script fails to get XML element value; specifically, I always pick up the default file (i.e., FILE_FOUND_RESP). Whenever there is an exception (for example, document unique ID is ILLEGAL) the default file is still selected but not the ILLEGAL_RESP file. I am seeking help to find out my mistakes. Thank you very much in advance.

Here is my Groovy script in soapUI.


This Groovy script is supposed to read through a XML file (shown below) and get the value of the element <DocumentUniqueId>:
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3068
    
  33

Are you sure the XPath is correct? What value does the documentId hold?


Mohamed Sanaulla | My Blog
Natalie Kopple
Ranch Hand

Joined: May 06, 2003
Posts: 325
I have done some tests by specifying each of the response files as the default response. They all work as expected.

Now, I believe the problem is the XPATH. However, I just cannot see the mistake. If anybody could help to see the XPATH, I would greatly appreciate.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: My Groovy Script Fails to Pick Up XML Element Value