有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java需要帮助找出为什么我在axlPort上出现异常。getPhone(axlParams)呼叫

我正在尝试运行“https://developer.cisco.com/docs/axl/#!javajax-ws-quickstart”上显示的axl演示

我是axl、eclipse和java的新手,只是想把脚弄湿

我遵循了列出的说明,项目在第行仅显示1个错误:

GetPhoneRes getPhoneResponse=axlPort。getPhone(axlParams)

错误类型表示AXL错误

编译器中没有显示其他错误

有谁能告诉我问题可能是什么,或者如何解决

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(); } }

实际上我也注意到了package explorer tree

包含以下代码:

package com.cisco.axlapiservice;

导入javax。xml。ws。WebFault

/** *这个类是由JAX-WSRI生成的。 *JDK 6中的JAX-WS RI 2.1.6 *生成的源版本:2.1 * */ @WebFault(name=“axlError”,targetNamespace=“http://www.cisco.com/AXL/API/10.5”) 公共级Axleror 扩展异常 {

/**
 * 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;
}

}

当我查看“getFaultInfo():AXLError”的内容时,我会看到“可序列化类AXLError没有声明long类型的静态最终serialVersionUID字段”,并提供了4个快速修复

但由于所有这些都是从callmanager下载的一部分,我认为其中不会有错误

也许这会给某人一个线索

谢谢


共 (0) 个答案