Combing Metro and Jersey
I've been at this for a little while and my mind has gone to mush.
I'm wondering if anyone can help me out here. I'm trying to make a Java Web Service (using its own HTTP server and not something like tomcat), that supports Metro and Jersey. This way a client can connect to the web service anyway they want whether it is SOAP or REST.
I've got the metro part down so it can support Doc/Lit wsdls and RPC/lit wsdls but I've 开发者_如何转开发having some difficultly understanding the Jersey part so it will support REST/xml and REST/json
Also the idea is that there would be one class where all the endpoint methods are written in and other classes would extend it.
Has anyone used these two combined before? Can you point me the direction of a decent article or do you have an example yourself?
Thanks
Metro is a implementaion of JAX-WS used mainly for WSDL/SOAP based webservices. Jesery is a implementation of JAX-RS used maily for Restful based webservices. I have used both in the same project but for different purposes. You can also use apache httpclient for restful services, but jersery provides lot of useful annotations for converting to json, xml etc. Hope it helps.
I am a bit confused about what you mean when you say you want to support Jersey. Jersey is an implementation of JAX-RS (JSR-311). Do you mean you want to support JAX-RS?
精彩评论