I am attempting to run the axl demo shown at 'https://developer.cisco.com/docs/axl/#!javajax-ws-quickstart'
I am a newbie to axl, eclipse, and java, and just trying to get my toes wet.
I have followed the instructions listed and the project only shows 1 error at line:
GetPhoneRes getPhoneResponse = axlPort.getPhone(axlParams);
The error type says AXL Error.
There are no other errors showing in the compiler.
Can anyone give me any ideas of what the problem could be, or how to chase it?
package com.cisco.axl.demo;
/**
* demo to pull basic phone info
*/
import javax.xml.ws.BindingProvider;
import com.cisco.axlapiservice.AXLAPIService;
import com.cisco.axlapiservice.AXLPort;
import com.cisco.axl.api._10.*;
/**
*
** @author t01136
** Performs Getphone using AXL API
** Service Consumers were generated by the java ?? wsimport command:
** wsimport -keep -b schema/current/AXLSOAP.xsd -Xnocompile -s src -d bin -verbose schema/current/AXLAPI.wsd
* and since AXL uses HTTPS, you will have to install the UC applications
* certificate into you keystore in order to run this sample app.
* You can run the program by CD'ing to the bin folder within this project
* C:\Users\t01136.POS\eclipse-workspace\axl-demo\bin
* and running the following command
* java -cp . com.cisco.axl.demo.Demo
*/
public class Demo {
/**
* UC app host.
*/
protected static String ucHost = null;
/**
* OS admin.
*/
protected static String ucAdmin = null;
/**
* OS admin password.
*/
protected static String ucPswd = null;
/**
* phoneName used in request.
*/
protected static String phoneName = null;
/**
* Run the demo
*
* @param args not used
*/
public static void main(String[] args) {
// Verify JVM has a console
if (System.console() == null) {
System.err.println("The Cisco AXL Sample App requires a console.");
System.exit(1);
} else {
Demo.informUser("%nWelcome to the Cisco AXL Sample APP .%n");
}
Demo demo = new Demo();
demo.getPhoneInfo();
}
/**
* get information about phone
*/
public void getPhoneInfo() {
// Ask for the UC application to upgrade
// Demo.informuser("%nWhat UC server would you like to access?%n");
ucHost = promptUser(" Host: ");
ucAdmin = promptUser(" OS Admin Account: ");
ucPswd = promptUser(" OS Admin Password: ");
// Ask for the phone name
Demo.informUser("%nEnter the name of the phone you want to retrieve information about.%n");
phoneName = promptUser(" Phone Name: ");
// Make the getPhoneRequest
getPhone();
}
//private String promptUser(String string) {
// // TODO Auto-generated method stub
// return null;
// }
/**
* Makes the getPhone request and displays some of the fields that are returned.
*/
private void getPhone() {
// Instantiate the wsimport generated AXL API Service client --
// see the wsimport comments in the class javadocs above
AXLAPIService axlService = new AXLAPIService();
AXLPort axlPort = axlService.getAXLPort();
// Set the URL, user, and password on the JAX-WS client
String validatorUrl = "https://"
+ Demo.ucHost
+ ":8443/axl/";
((BindingProvider) axlPort).getRequestContext().put(
BindingProvider.ENDPOINT_ADDRESS_PROPERTY, validatorUrl);
((BindingProvider) axlPort).getRequestContext().put(
BindingProvider.USERNAME_PROPERTY, Demo.ucAdmin);
((BindingProvider) axlPort).getRequestContext().put(
BindingProvider.PASSWORD_PROPERTY, Demo.ucPswd);
// Create a GetPhoneReq object to represent the getPhone request and set the name of the device
//to name entered by user
GetPhoneReq axlParams = new GetPhoneReq();
axlParams.setName(phoneName);
//Make a call to the AXL Service and pass the getPhone request
GetPhoneRes getPhoneResponse = axlPort.getPhone(axlParams);
//display information returned in the response to the user
Demo.informUser("Product=" + getPhoneResponse.getReturn().getPhone().getProduct() + "%n"
+ getPhoneResponse.getReturn().getPhone().getLoadInformation().getValue() + "%n");
}
// -------------------- Some I/O Helper Methods ------------------------
/**
* Provide the user some instructions.
*/
protected static void informUser(String info) {
System.console().format(info);
}
/**
* Ask the user a question
*/
protected static String promptUser(String question) {
String answer = null;
while (answer==null || answer.isEmpty() ) {
answer = System.console().readLine(question);
}
return answer.trim();
}
}
That contained the following code:
package com.cisco.axlapiservice;
import javax.xml.ws.WebFault;
/** * This class was generated by the JAX-WS RI. * JAX-WS RI 2.1.6 in JDK 6 * Generated source version: 2.1 * */ @WebFault(name = "axlError", targetNamespace = "http://www.cisco.com/AXL/API/10.5") public class AXLError extends Exception {
/**
* Java type that goes as soapenv:Fault detail element.
*
*/
private com.cisco.axl.api._10.AXLError faultInfo;
/**
*
* @param message
* @param faultInfo
*/
public AXLError(String message, com.cisco.axl.api._10.AXLError faultInfo) {
super(message);
this.faultInfo = faultInfo;
}
/**
*
* @param message
* @param faultInfo
* @param cause
*/
public AXLError(String message, com.cisco.axl.api._10.AXLError faultInfo, Throwable cause) {
super(message, cause);
this.faultInfo = faultInfo;
}
/**
*
* @return
* returns fault bean: com.cisco.axl.api._10.AXLError
*/
public com.cisco.axl.api._10.AXLError getFaultInfo() {
return faultInfo;
}
}
and when I look at the contents of 'getFaultInfo():AXLError' I see 'The serializable class AXLError does not declare a static final serialVersionUID field of type long', with 4 quick-fixes available.
But since all of that was part of the download from callmanager, I wouldnt think there would be an error in it.
Perhaps this will give someone a clue.
thanks