Apparently, Groovy easily consumes web services. Can it consume a web service that needs JAX-RPC instead of JAX-WS? Should I use an older version of Groovy or its libraries to do so?
Apparently, Groovy easily consumes web services. Can it consume a web service that needs
Share
It’s really easy to consume XML-RPC web services. You need the Groovy XML-RPC as well as the Smack library in your classpath.
I wrote some groovy scripts to work with our Atlassian Confluence wiki and here’s a short example to retrieve a wiki page using XML-RPC:
You use the
XMLRPCServerProxyto access the XML-RPC services. If your services require complex parameters as parameters or return one, these are represented as Groovy maps, with the attribute name as key and it’s value as the corresponding value. In the script above, the servicegetPagereturns a Page object, which is a map, but as you can directly access a map’s key using the dot-notation in Groovy,page.contentis the same aspage.get("content").