1

我已经实现了 Apache CXF WebService 并尝试通过 Swings 应用程序访问 WebService。我面临的问题是 CXF 在客户端从 WSDL 创建了一个名为 Exception_Exception 的类。当服务器端发生异常时,客户端 Exception_Exception 会被调用,但我在 Exception_Exception 堆栈跟踪中没有收到与服务器相同的堆栈跟踪。下面是 CXF 生成的类:

package com.abc.it.vcare.service;

import javax.xml.ws.WebFault;


/**
 * This class was generated by the JAX-WS RI.
 * JAX-WS RI 2.2-hudson-752-
 * Generated source version: 2.2
 * 
 */
@WebFault(name = "Exception", targetNamespace = "http://service.vcare.it.abc.com/")
public class Exception_Exception
    extends java.lang.Exception
{

/**
 * Java type that goes as soapenv:Fault detail element.
 * 
 */
private com.axiom.it.vcare.service.Exception faultInfo;

/**
 * 
 * @param message
 * @param faultInfo
 */
public Exception_Exception(String message, com.axiom.it.vcare.service.Exception faultInfo) {
    super(message);
    this.faultInfo = faultInfo;
}

/**
 * 
 * @param message
 * @param faultInfo
 * @param cause
 */
public Exception_Exception(String message, com.axiom.it.vcare.service.Exception faultInfo, Throwable cause) {
    super(message, cause);
    this.faultInfo = faultInfo;
}

/**
 * 
 * @return
 *     returns fault bean: com.axiom.it.vcare.service.Exception
 */
public com.axiom.it.vcare.service.Exception getFaultInfo() {
    return faultInfo;
}

}

请帮忙,我应该怎么做才能在我的客户端 Exception_Exception 中获得服务器异常中给出的相同 StackTrace。

谢谢,杰·G。

4

1 回答 1

1

What version of CXF are you using? This is an old CXF issue that has been addressed in the most recent versions. Try using version 2.7.0 of CXF, that should solve the problem.

于 2012-11-20T17:12:32.920 回答