24 Nisan 2009 Cuma

GWT jaxws, json vs soap problem

I want to deploy soap web services and some gwt client prefers the services in json format for direct json support of gwt, similar to the situation in http://www.mail-archive.com/users@cxf.apache.org/msg03146.html.
Btw, I use jaxws in developing web services, actually metro web service stack.. I am lucky that jaxws supports json (https://jax-ws-commons.dev.java.net/json/) by just annotating the binding type as json.. @BindingType(JSONBindingID.JSON_BINDING)
Therefore, in the worst case I may deploy that gwt client's json services seperately and still use metro ws stack in ws development..
However, I bumped into a better solution :) http://enunciate.codehaus.org/
I first checked if it is dead and happily saw that the latest release is about a month ago :)
Enunciate is a web service deployment framework. The promise is leaving the developer only source code development with metadata (annotations) and taking care of all the other details such as deployment descriptors including interoperability.. Enunciate promises to give multiple endpoints automatically to the deployed web service.
This is a first step blog on enunciate: http://dustinbreese.blogspot.com/2008/01/enunciate.html
Enunciate's own getiing started doc is here: http://enunciate.codehaus.org/getting_started.html

Lets start!
I used apache tomcat 5.0.28 as web server and Eclipse ide.
-created the example wannabecool project as dynamic web project and added tomcat runtime to the project. -copied stuff $ENUNCIATE/samples/wannabecool/src/main/java under my src folder.
-added jars ander $ENUNCIATE/lib to my project to get rid of compile errors.
-copied $ENUNCIATE/samples/wannabecool/build.xml to my project. In that file,I set enunciate.home properly. While running the ant script, I got this error:
/usr/share/myprograms/ECLIPSEHOME/workspace/ganymede-workspace/wannabecool/build.xml:27: java.lang.NoClassDefFoundError: com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
So, I downloaded jaxb-xalan-1.5.jar and added to classpath. This fixed the error.
However, the war file did not work under tomcat (http://jira.codehaus.org/browse/ENUNCIATE-212)
So, I tried jetty.. I got the following error at first:
SEVERE: Context initialization failed
Throwable occurred: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.annotation.internalCommonAnnotationProcessor': Initialization of bean failed; nested exception is java.lang.NullPointerException
So, I commented out the following lines in web.xml (it affected the rest part actually) and bingoo :)

Enter http://localhost:8080/wannabecool/ to check.. Wsdl is here: http://localhost:8080/wannabecool/api.wsdl
However, the REST part is currently problematic due to the change in web.xml..

Hiç yorum yok:

Yorum Gönder