Author Message
DavidMatthews3
Joined: Nov 15, 2012
Messages: 11
Offline
I have an installation of ADD 5.1 that is integrating to Web Services using Axis2 1.5 with no issues. We upgraded
our IVR to AAOD 7 which uses Axis2 1.6.2. The wsop2 files were created (previously) using the attached WSDL file. Since we've
upgraded the IVR, the Web Services no longer work. At runtime the client stub (generated code) creates the following XML request:

<?xml version='1.0' encoding='utf-8'?>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns1:getCustomerProfile xmlns:ns1="http://www.smud.org/WebServices">
<ns1:contractAccount>123433</ns1:contractAccount>
<ns1:deviceNumber></ns1:deviceNumber>
<ns1:phone></ns1:phone>
<ns1:ani></ns1:ani>
<ns1:ssn></ns1:ssn>
<ns1:houseNumber>3323</ns1:houseNumber>
<ns1:useShadow>N</ns1:useShadow>
</ns1:getCustomerProfile>
</soapenv:Body>
</soapenv:Envelope>


The Web Service just returns that a failure has occurred. If I remove the ns1: from the elements this request works just fine in SoapUI. However, in AAOD 7 Axis2 1.6.2 enforces each element to have a namespace, and that won't work. This Web Service resides on a WebMethods ESB.

In ADD 5.1 the client stub was generating the following XML request at runtime, which worked perfectly fine.

<?xml version='1.0' encoding='utf-8'?>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns1:getCustomerProfile xmlns:ns1="http://www.smud.org/WebServices">
<contractAccount>123433</contractAccount>
<deviceNumber></deviceNumber>
<phone></phone>
<ani></ani>
<ssn></ssn>
<houseNumber>3323</houseNumber>
<useShadow>N</useShadow>
</ns1:getCustomerProfile>
</soapenv:Body>
</soapenv:Envelope>


Any ideas how to get this working again in AAOD 7? I suppose one option is to downgrade the Axis2 jar files to Axis2 1.5, but I wouldn't think that's not recommended.
Filename SmIVR.AccountServices.ws_1_v7.wsdl [Disk] Download
SamareshKowshik
Joined: Nov 6, 2013
Messages: 351
Offline
Do you have access to, or are able to, modify the web service?
DavidMatthews3
Joined: Nov 15, 2012
Messages: 11
Offline
Yes. What do you think needs to change on the Web Service? The Web Service was built in a graphical environment that's an Eclipse plug-in for WebMethods.
SamareshKowshik
Joined: Nov 6, 2013
Messages: 351
Offline
I don't think I'm familiar with the development environment you're describing, but making the change shouldn't be too hard. For example, using the web service creation wizard in Eclipse, you can have it generate the server side code from the WSDL. Using the modified WSDL, with the schema attribute elementFormDefault="qualified" set, it would then recreate the class files so it expects elements to have a namespace prefix. The two sides, server and client, should then be in sync and the call should work without error.
DavidMatthews3
Joined: Nov 15, 2012
Messages: 11
Offline
Thanks for the idea Samaresh. Unfortunately it will not work for us because the team built their Web Service using a graphical (drag-and-drop) tool and cannot modify any of the generated source. Even the WSDL is generated and cannot be modified. So I am stuck trying to meet the XML spec which is enforced by Axis2 and the server side not wanting to accept elements prefixed with namespace. I don't know where to go from here.

Is it possible to downgrade the Axis2 jar files in AAOD 7?

Thanks for your continued replies.
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.
DavidMatthews3
Joined: Nov 15, 2012
Messages: 11
Offline
Thanks for the excellent and detailed answer! I very much appreciate your thoroughness Samaresh!!
TomWang2
Joined: Sep 26, 2014
Messages: 99
Offline
Hello,

I follow each step as what you descripted, It is working in my local machine, but has error when deployed application to WAS 8.5.5.
Enclosed is error message got from SystemOut.log in WebSphere 8.5.5. Could you check what is wrong ?

Thank you in advance.

Filename Error_Message_Follow_Steps.txt [Disk] Download
Filename Classpath_Setting.docx [Disk] Download
TomWang2
Joined: Sep 26, 2014
Messages: 99
Offline
Hello, Please forget previous email and attached files. This is latest update:

1. Axis2-1.5.6 is to replace previous axis2-1.4.1
2. Claaapath is as the following:

/usr/local/IVR/P2/Ext/VPWebServiceClient-07.00.00.01.jar
/usr/local/IVR/P2/Ext/VPAppLogClientWS_7.0.0.jar
/usr/local/IVR/P2/Ext/sunjce_provider.jar
/usr/local/IVR/P2/Ext/axiom-api-1.2.12.jar
/usr/local/IVR/P2/Ext/axiom-dom-1.2.12.jar
/usr/local/IVR/P2/Ext/axiom-impl-1.2.12.jar
/usr/local/IVR/P2/Ext/axis2-adb-1.5.6.jar
/usr/local/IVR/P2/Ext/axis2-adb-codegen-1.5.6.jar
/usr/local/IVR/P2/Ext/axis2-codegen-1.5.6.jar
/usr/local/IVR/P2/Ext/axis2-kernel-1.5.6.jar
/usr/local/IVR/P2/Ext/axis2-saaj-1.5.6.jar
/usr/local/IVR/P2/Ext/axis2-transport-http-1.5.6.jar
/usr/local/IVR/P2/Ext/axis2-transport-local-1.5.6.jar
/usr/local/IVR/P2/Ext/neethi-2.0.5.jar


3. In my local machine, Application is working properly.
4. In WAS8.5.5, Runtimeconfig webpage could not lauch.
5. When make phone call to IVR, Error message happened and is attached
Filename Axis_1.5.6_error.txt [Disk] Download
TomWang2
Joined: Sep 26, 2014
Messages: 99
Offline
if I add 4 more jar files from axis2-1.5.6 to above classpath:

/usr/local/IVR/P2/Ext/axis2-json-1.5.6.jar
/usr/local/IVR/P2/Ext/woden-api-1.0M8.jar
/usr/local/IVR/P2/Ext/woden-impl-dom-1.0M8.jar
/usr/local/IVR/P2/Ext/XmlSchema-1.4.3.jar

Error message will be different:

[2/22/15 11:57:24:769 MST] 000000a2 ServletWrappe E com.ibm.ws.webcontainer.servlet.ServletWrapper service Uncaught service() exception thrown by servlet Start: java.lang.LinkageError: loading constraint violation when resolving method "org/apache/axis2/client/FaultMapKey.<init>(Ljavax/xml/namespace/QName;Ljava/lang/String;)V" : loader "com/ibm/ws/classloader/ExtJarClassLoader@588cd14e" of class "com/avaya/xml/ws/vpappvars/voiceportal/VPAppVarsServiceStub" and loader "org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader@96190812" of class "org/apache/axis2/client/FaultMapKey" have different types for the method signature
at com.avaya.xml.ws.vpappvars.voiceportal.VPAppVarsServiceStub.populateFaults(VPAppVarsServiceStub.java:66)

Attached is whole log file from restart server to make phone call.
Filename Axis2-1.5.6-error.txt [Disk] Download
TomWang2
Joined: Sep 26, 2014
Messages: 99
Offline
Hello SamareshKowshik, I follow your previous post and solved my issue. Thank you so much. please ignore my previous a few message.

Regards
SamareshKowshik
Joined: Nov 6, 2013
Messages: 351
Offline
Great! Glad to hear it worked!
Go to:   
Mobile view