Search code examples
soapgroovygroovyws

What is the standard SOAP library to use in groovy?


I just need a SOAP client to make remote calls, but I'm a bit of a Groovy noob. According to the Groovy documentation, the standard Groovy SOAP library is deprecated. Instead, the docs point you to a newer library: GroovyWS.

Unfortunately, GroovyWS has a warning that says the project is dormant and it then points you to Groovy WSLite.

Groovy WSLite actually still appears to be under active development, but not very 'Groovy-ish' compared to the previous 2 libraries. Is wslite what everyone is using?


Solution

  • I think you would find both GroovyWS and groovy-wslite (and HTTP Builder) are in use as Groovy SOAP client libraries in projects and the decision was probably one of which one worked and which one had the API/approach the user preferred (in that order).

    My advice would be to give GroovyWS a try if you like the API it provides and its ability to proxy a WSDL document and see if it works for the services you need to interact with. Things have not changed much in the SOAP world so I would not worry too much about how recently it has been updated. If it works then you are done, if you experience some issues that you are not able to readily find help for then I would try the alternatives.

    groovy-wslite (disclaimer: I'm the author) aims to provide a lightweight (in terms of dependencies) alternative that trades the convenience of WSDL parsing/proxying for making it easier to have more control over the resulting soap call without having to dig deep into the internals of some underlying Java framework like CXF. Some prefer having the additional features of a library built on top of a framework like this while others may prefer the simplicity of the other approach.

    The thing that makes Groovy so great is how easy it is to integrate with Java. So, as others have already pointed out, you can integrate with Java web service clients like Spring WS, CXF, and JAX-WS pretty easily.