Difference between Axis and Axis2 to develop Web Service

做~自己de王妃 提交于 2019-12-01 17:31:16

问题


In my project, I will have to develop a some data in/out interfaces based on Web Service technology. So until now I have studied about it.

What I am curious about Web Service with Java is what library I can use or not.

As I searched java library, I found that Axis2 and CXF are very common and famous java w/s library. The problem is I have to use RAD 7.0 which contains axis.

It seems there are huge change between Axis and Axis2 and unfortunately I can't use Axis2.

Now, my partner provides WSDL and I have to implement client-side W/S. If I create client-side proxy code from WSDL by Axis or Axis2 or CXF, are they all same code?

Or If I have to make WSDL to provide my W/S interface with Axis, can it be the problem to Axis2 or CXF user?

In my circumstance, I am very new and afraid of using Axis. Can anybody give me some advice??

thanks.

have a good day.


回答1:


No, each of them generates a different code. Though they all work for the same purpose.

I personally prefer Axis2 over Axis.

Just to get various pros and cons on each of them, you can go through this: comparison link




回答2:


Some other differences I found :

  • Axis only support till JDK 1.4 not Java 5 Axis 2 supports Java 5 and on wards.

  • Axis is RI of old JAX-RPC 1.1 , Axis 2 is implementation of new JAX-WS 2.x

  • Axis don't support Annotations , Axis 2 supports annotations so supports new way of developing webservice with annotations e.g @Webservice / @ Webmethod annotations.




回答3:


Through experience, I did find that some WSDLs can get parsed by Axis1 but not Axis2 and some messages being sent by Axis2 does not work on services that have worked with Axis1.

Nuances in arrays from generated WSDLs rather than hand written ones and accented characters being interpretted differently by the server side (i.e. works with CDATA but not without)

On a personal note, I use whatever wsimport generates from the JDK rather than some other tool, but some frameworks such as Curam require axis/axis2




回答4:


Some WSDLs can get parsed by Axis1 but not Axis2. And Axis1 is supported till Java 1.4 version after that you get exception related to enum keyword.

use -source 5 or higher to use 'enum' as a keyword.

Because Axis is generating java classes with enum keyword in it.

You could override these classes and package names(as done in Axis2 for enum package to constant) and make your own managed version of Axis compatible with Java 1.5 or higher. I have created my own managed version of axis to support legacy wsdl on java 1.5 or later and it is working even with java 10.

And better to use axis or axis2, as it is standard and required on certain framework or technology.



来源:https://stackoverflow.com/questions/13700943/difference-between-axis-and-axis2-to-develop-web-service

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!