SamareshKowshik
Joined: Nov 6, 2013
Messages: 351
Offline
|
It is possible to downgrade to the older jars. The steps to do the downgrade are below. It might look a bit daunting, but mostly it's the setup that takes time:
1. Download the older jar files. I tried getting the Axis2 1.5 release, which is what OD 6 uses, but for some reason the link doesn't work. However, Axis2 1.5.6 does have a valid link, and the code to create the request/response, especially the namespace part, works the way you need it to. The link for it is below:
http://axis.apache.org/axis2/java/core/download.cgi
The first time I tried the download link there it didn't work, so if it's down let me know and I can send the zip.
2. This step is optional if you're comfortable with using the command line (directions on using wsdl2java on the command line are given at the end), but using this tool might be easier since it's integrated into Eclipse. It's Apache's Code Generator plug-in. The link is here:
http://www.apache.org/dyn/mirrors/mirrors.cgi/axis/axis2/java/core/1.5.6/axis2-eclipse-codegen-plugin-1.5.6.zip
There is also a page that details how the plugin works, if you want it for reference later. I'll go through how to make it work for OD, though:
http://axis.apache.org/axis2/java/core/tools/eclipse/wsdl2java-plugin.html
To install it, just unzip the jar file in that zip file to the "dropins" directory in Eclipse. Make sure you put the jar file directly into "dropins" and don't also create a "plugins" directory there. You'll have to restart Eclipse once you do so. One thing about using this is that you kind of need to match the plugin version to the version of Axis2 you are going to use. Otherwise, you get Java errors. The zip here is meant for the 1.5.6 release of Axis2.
3. Once it's unzipped and Eclipse is restarted, you will find the new wizard by going to:
File -> New -> Other -> Axis2 Wizards -> Axis2 Code Generator
4. Once it's started, select to Generate Java source code from a WSDL and hit Next.
5. Point the wizard to the location of the WSDL on the second page and hit Next.
6. On the third page, choose the following options:
-Codegen option: Custom
-Custom package name: <the name of your output package (default is "connectivity.ws.beans")>
-Generate both sync and async: deselect this and instead choose "Generate sync style only"
7. Click on Advance Options and choose the following options:
-Unpacks the databinding classes: uncheck this box
-Switch on un-wrapping: check this box
-Overwrite the existing classes: check this box
-Dont generate the build.xml in the output directory: check this box
Click OK to go to the previous screen.
8. On the fourth page, you select the output directory. You can select the first radial "Browse and select..." option, and then choose to put the files directly into the beans package. Point the Output path to be the WEB-INF directory, not the src directory or the bean directory. Otherwise, it creates the wrong names. An example Output path is this:
C:\tools\OD 7\workspace\asdf\WEB-INF
9. Hit Finish and it will create the Java files.
10. If you refresh the project (hit F5 or just let it refresh automatically), you will notice a ton of errors. Now that the Java is recreated, you have to point the Build Path to the older 1.5.6 jar files. The jars OD uses are the following:
axiom-api
axiom-dom
axiom-impl
axis2-adb
axis2-adb-codegen
axis2-codegen
axis2-kernel
axis2-saaj
axis2-transport-http
axis2-transport-local
neethi
There are version numbers in the actual file names, which I didn't include. I also didn't include it, but there are a few other jars as well that OD uses, but the versions are the same between releases so you don't have to copy them. Unzip those jars to the directory of your choosing. I put mine in the /lib directory for my Tomcat, which I found was easier. Also, I didn't do this, but I suppose you could just unzip everything from the 1.5.6 zip file.
11. Right click on the project, go to Properties, and then Java Build Path. Choose the Libraries tab at the top and rename each jar in question to the new one. If you put them in the /lib folder in Tomcat, you can Edit each one and quickly just change the version numbers.
12. Click OK to close the Properties. The project should rebuild and the errors should now be gone. There are some Warnings listed, but they can be ignored.
13. Run the project and make sure it all works.
That should be it. Following the above steps, OD created the request without the namespace prefixes for me. There are a couple of things to keep in mind, though. First, because this is custom, when you export a project and create the runtime support files, it won't export the 1.5.6 jars. You would then need to add them to the runtime support zip manually. Second, if you recreate the WSOP, it will rewrite the Java in the beans directory. Of course, you can just run steps 3-9 above and reverse that. Third, I didn't test exporting the project and importing into another OD environment, but I don't imagine it will run smoothly. Just importing a new project can cause OD's Project Upgrade to kick in, so keep this in mind. You should always be able to use the above steps to downgrade, though.
Lastly, a word on the Code Generator plugin. It's got a lot of buttons to press and things to tick, and it doesn't remember what you last did. That can get to be a little tiresome, at least it was for me, so the alternative is to use wsdl2java from the command line, which is basically what the plugin wizard does. The tool is located in the /bin directory of the Axis2 zip, and the command, with correct switches for OD, is the following:
wsdl2java.bat -o src -s --noBuildXML -d adb -uw -p connectivity.ws.beans -uri SmIVR.AccountServices.ws_1_v7.wsdl -or
Using that assumes a few things, though. You have to have the AXIS2_HOME and JAVA_HOME environmental variables set in Windows. AXIS2_HOME points to your Axis2 directory. JAVA_HOME points to your JDK installation. Then, you'd need to have the WSDL in the same /bin directory. Also, the bean directory is set to "connectivity.ws.beans", which you might need to change in the command. And finally, the output would need to be manually copied into Eclipse. It's all doable, but Apache's plugin sort of does the setting up and copying for you. The only big difference is that, to my mind, running a single command is easier than clicking through a wizard, especially once you do the one time setup of variables. Either way works, though.
There are a lot of steps and things to go wrong in the above, so let me know if anything needs clearing up or doesn't work.
|