Difference between Axis and Axis2 to develop Web S

2019-02-22 20:09发布

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.

标签: axis2 axis rad
4条回答
我命由我不由天
2楼-- · 2019-02-22 20:26

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.

查看更多
Melony?
3楼-- · 2019-02-22 20:33

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

查看更多
We Are One
4楼-- · 2019-02-22 20:40

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.

查看更多
仙女界的扛把子
5楼-- · 2019-02-22 20:46

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

查看更多
登录 后发表回答