Forum Discussion

ravibabu_it's avatar
ravibabu_it
Occasional Contributor
7 years ago
Solved

Unable to call Java method using groovy script

All, I have created jar file with name readXML.jar and placed the jar file in bon/ext folder. I have the imported the package and called the required java method as below   import readXML.readXMLR...
  • nmrao's avatar
    7 years ago
    1. From the error & attachment, there is not static method in the java class
    2. Create the class object & then call the method
    3. It is directly not relevant, but just providing the feed back on the naming conventions
      • class name should use Init Caps. Say : ReadXmlResponse
      • method name should start with lower case and followed by Init Caps. Say : getData()
      • in this case, the method can be static

     

    If you want to process the xml, you do not have to use java which needs lot of instruction, instead use groovy and is very easy to do it.

     

    You can find some samples below:

    https://github.com/nmrao/soapUIGroovyScripts/search?utf8=%E2%9C%93&q=xml&type=

     

    https://github.com/nmrao/groovyScripts/tree/master/xml