cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
752
Views
1
Helpful
0
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: Hoang Anh Tran on 05-10-2013 06:02:20 AM
Dear all,
I am new to AXL developing, I have read the tutorial: How to ... Create an AXL Java Client using JAX-WS at http://developer.cisco.com/web/axl-developer/axl-java-sample-application

I
 did import CUCM server certificate (self-signed) to Java keystore as instructed, add alias with IP address of the server.
Server is running at https://172.16.3.143:8443/axl/ . with CUCM v9

The code I am trying to run is extracted from sample code of the tutorial, and modified a bit to display in a GUI Text Area

It always throw exception at line: GetPhoneRes getPhoneResponse = axlPort.getPhone(axlParams);

 1[size=1]// Instantiate the wsimport generated AXL API Service client --       
 2// see the wsimport comments in the class javadocs above       
 3AXLAPIService axlService = new AXLAPIService();               
 4AXLPort axlPort = axlService.getAXLPort();
 5
 6       
 7// Set the URL, user, and password on the JAX-WS client       
 8String validatorUrl = "https://172.16.3.143:8443/axl/";
 9
10       
11((BindingProvider) axlPort).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, validatorUrl);
12((BindingProvider) axlPort).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "admin");
13((BindingProvider) axlPort).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "P@ssW0rd");
14
15// Create a GetPhoneReq object to represent the getPhone request and set the name of the device
16//to name entered by user
17GetPhoneReq axlParams = new GetPhoneReq();
18axlParams.setName("SEPF02929E3CFB9");
19
20//Make a call to the AXL Service and pass the getPhone request
21[color=#ff0000]GetPhoneRes getPhoneResponse = axlPort.getPhone(axlParams);[/color]
22
23//display information returned in the response to the user
24this.jtaOutput.setText("Product=" + getPhoneResponse.getReturn().getPhone().getProduct() + "%n"+ getPhoneResponse.getReturn().getPhone().getLoadInformation().getValue() + "%n");[/size]
And the error message I am having is copied in attached txt file

Please help me out, I really need to pass this starting point. Thank you very much



Subject: RE: Help running Java sample AXL code? stuck at CertificateException
Replied by: Maic Naatz on 28-11-2013 06:40:38 AM
hi,

i am a newbee with java and have the same problem. I am trying to run the example from http://developer.cisco.com/web/axl-developer/axl-java-sample-application with the same error stored in error.txt above. Only difference, my operating system is Windows 7 and my imported certificate has the hostname from CUCM as alias. I imported that into my private keystore (C:\Users\\.keystore) and also into the cacerts file from corresponding java version (1.6.0_45). Maybe one of them is enough. I do not modify the demo.java file. Finally i compiled the Demo class to an jar-file (Demo.jar) to run it from windows command line with java -jar [Path to file]\Demo.jar. Is there an other possibility to start the example without compiling available?

Additionally there is a problem after importing the wsdl-file with wsimport tool (i use  Java 1.6.0_45 witch is different from 1.7.0_45). Some of the AXL-request have an red cross at the icon.
My import command was:
"C:\Program Files (x86)\Java\jdk1.6.0_45\bin\wsimport.exe" -keep -b schema/current/AXLSOAP.xsd -Xnocompile -s src -d bin -verbose schema/current/AXLAPI.wsdl
After the imort it seems to be okay. But waiting a little bit, the crosses accur. The schema was downloaded from my CUCM within the AXL toolkit.zip.

I am very grateful for an more detailed description to start with axl in java.
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links