• Post Reply Bookmark Topic Watch Topic
  • New Topic

migrate from axis1 to axis2  RSS feed

 
Lin Ye
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My current situation is:
gSoap is the web service server to deploy c web services. So I use soapcpp2 to create a xxxx.wsdl file.
Then I use axis1 wsdl2java to create java client code.
All these work well. And I invoke APIs these created by axis1 to get the real business data to do some handle and finally show them in WEB page.

Now I am going to upgrade axis1 to axis2 from the client side. My ideally wish I don't need to change or only change little of my existed invocation code after the upgrade. But that is not kind of possible base my knowledge.

I occur the big question like this:
1. When I use wsdl2java of axis1, that create many java files like: xxx_BindingStub.java, xxx_Service, xxx_ServiceLoader, xxxPortType. And another folder of "holders", that include many files the name end with xxxHolder.java.

But When I use wsdl2java of axis2, I can not find any of those created by axis1. Instead, there are some java files like: xxxStub, xxxSkeletonInterface. And I cannot find any files with name end of Holder.

So that led me to think I can not upgrade from axis1 to axis2 if I have had some code to invoke the WEB Service API created by AXIS1. Or I have to re-implement all these invocation call.

Now my questions is:
1. Because wsdl2java for AXIS1 and AXIS2 will create different java files base on same wsdl file, could I have some parameters to control axis2 to create the same files with axis1? If that possible, how? And will there have a performance improvement?

2. If I can not create same files with axis1, does that means all my existed invocation must be changed to use axis2 API? Or if there is a simple way to migrate it?

3. I use userNameToken in axis1 header. After I instance the xxxPortType by providing the service url, I need to instance the SOAPHeaderElement and wsse:userNameToken and set them to the xxxPortType. But in axis2, what should I do?
 
Kesava Krishna
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer to your first question is no, reason being from axis2 onwards jax-ws comes in picture, hence stub classes generated from wsdl will change
The above statement also answers your second question. So you need to re-compile and change the classes according to the generated stubs.
For ws-security using axis2 please try this link http://mcarrolle.wordpress.com/2009/09/30/using-cxf-and-ws-security/

Thanks,
Kesava
 
Lin Ye
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much. That is very useful for me. I will try this method later on.
Your example seems use the parameter -w rather than -uw for the wsdl2java command. So that have to create options. Am I right?
But the part of creating the security is very useful for me.

Before I got your method, I tried another way. (I use the -uw to create java code, that allow me to invoke the method directly instead of using the code like: opClient.execute(true);)
I found the security is created as a java bean after I use axis2 that implement to ADBBean. So when I instance it and set the credential. All work well.
I paste my way here in case someone else occur the same issues with me .

So I still have some questions:
1. I believe your way will work well too. But that's the different between your way and mine?
2. After I create the java code with parameter: "<arg line="-ns2p http://www.xxx.com/test/v12=xxx1.xxx2.xxx3"/>" and "<arg line="-p xxx1.xxx2.xxx3"/>", all files are go to the right package (xxx1.xxx2.xxx3) except the security bean.
There is another package path like this: "www.aaaa.v12.wsse_xsd", the security bean is located under there. Because the targetNamespace of security part like this: http://www.xxx.com/aaaa/v12/wsse.xsd.
Even I add parameter like this: <arg line="-ns2p http://www.xxx.com/aaaa/v12/wsse.xsd=xxx1.xxx2.xxx3.security>, the package path: "www.aaaa.v12.wsse_xsd" still be created and the security bean is under there.
Could you help me to figure out what's wrong with my code. How could I forbid to create another package like "www.aaaa.v12.wsse_xsd" and put the security bean under "xxx1.xxx2.xxx3" that what I specified.

Thanks~~
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!