开发者

Suggestion for a web service framework for Java

开发者 https://www.devze.com 2022-12-18 06:43 出处:网络
I want a web service framework which is open source & free for commercial use, also security is a main concern too. Please suggest a web service framework fo开发者_StackOverflowr Java using SOAP s

I want a web service framework which is open source & free for commercial use, also security is a main concern too. Please suggest a web service framework fo开发者_StackOverflowr Java using SOAP standard.


I'd suggest a JAX-WS implementation: JAX-WS RI (which is part of Metro) or Apache CXF. Both are very close from a runtime perspective but many people find that CXF has a better documentation (might be an important criteria). Both provide integration with Spring if this matters to you (actually, decent frameworks just can't ignore Spring so this is not a surprise).

Spring-WS is another option but is not JAX-WS compliant, supports only a contract-first approach (from XSD) - that's a philosophical choice - and doesn't support many WS-* standards (that you may not need though).

In any case, I'd stay away from Axis 2 and its horrible deployment architecture and packaging hell (the Axis 2 webapp itself is a container for web services which need to be packaged in specific archives). I find it totally counter productive. On top of that, it doesn't even perform really well.


Here are the common frameworks, all are rather mature:

  • Apache CXF
  • Apache Axis2
  • Spring Web Services
  • JAX-WS RI

All support SOAP.

I've used both CXF and Spring-WS. Both are easy to configure and use.


Spring framework will be the definite winner for this kind of requirement. Spring and its modules including spring security, spring webservices makes it a right fit for this one.


Take a look at Axis. It's quite simple and easy to use. http://ws.apache.org/axis/


I agree with the Spring-WS option. I've used it at various times and it quickly become my web service choice unless there are other factors that specifically rule it out.

Although this is slightly off topic, if you're in the planning stage I'd make the following recommendations.

  1. Choose a topdown approach. Spring-WS definately supports this (it is the preferred method). That way if you make changes to the underlying code you won't need to worry about accidentally updating your WSDL. Also at design time you can consider the WSDL the interface point and not go through other elaborate documents as much.

  2. Use JAXB to generate your request/response objects. This is much easier in the long run and definately helps to make sure that you are coding as required by your WSDL (quite a few times I looked at generated objects and saw that they didn't look right only to find out that I had modified the WSDL incorrectly).

  3. Use annotations in your endpoints.

Those are the main points. Good luck :-).


I'd use the one provided with Java.

http://java.sun.com/webservices/docs/2.0/tutorial/doc/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号