• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Groovy, Web Services and EJBs

 
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How easy would it be to use Groovy to expose Web Services to the outside world , and to implement these services as Groovy scripting, and calls to existing Java POJOs, and EJBs inside an application server (lets say WebSphere.)? Is this a suitable use for Groovy?
 
Author
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If by "Web Services" you mean "SOAP", support is there but it's not mainstream. SOAP is reaching the end of its natural life (Google deprecated its SOAP services in 2006 in favor of REST; Yahoo! has always been RESTful to the best of my knowledge.), and that's reflected in many modern languages.

You'll find great support in Grails for REST and JSON "Web Services". There's an XFire plugin for SOAP, as well as plugins for RSS and Atom. I have an entire chapter dedicated to this broader, more inclusive definition of Web Services.

The good news is Groovy can use any Java library for SOAP, so you are in good shape there. The same is true for calling existing POJOs and EJBs -- Groovy can call Java seamlessly, and Java can call Groovy seamlessly. Groovy classes can implement Java interfaces and vice versa.

Groovy can quite literally do anything that Java can do because it _is_ Java.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
codehaus has a nice writeup on Groovy SOAP. I've used this to take legacy Java code and turn it into a web service in just minutes.

http://docs.codehaus.org/display/GROOVY/Groovy+SOAP

But the Groovy SOAP jar link in the writeup is now broken. There's a few comments in the wiki reporting that the link is broke but so far no progress. Does anyone know what's up? Is the latest version of Groovy not compatible with that SOAP jar?

You can get the groovy soap jar here
http://momupload.com/files/77499/groovysoap-all-1.0-0.3-snapshot_jdk1.5.0.jar.html
 
Steve Wink
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, thats helpful.
 
Liz Ardu
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know how I missed this before but there's a new groovy module: GroovyWS

http://docs.codehaus.org/display/GROOVY/GroovyWS

from the page: "GroovyWS is taking over GroovySOAP as CXF replaces XFire. The major difference here is that GroovyWS is using Java5 so if you need to stick to 1.4 please continue to use GroovySOAP."

I attempted to use GroovyWS and immediately encountered an odd error when trying out the simple server example. After staring at the problem and then finally using GWhich (a groovy-fied version of JWhich), I found that with the GroovySOAP jar in the groovy/lib folder, a wrong class is loaded. After removing the SOAP jar, all is well.

I have used XFire before but had never heard of CXF. This Apache incubator project looks pretty cool. The support for RESTful HTTP especially looks interesting to me.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic