我有服务器,服务器方法抛出我的异常 - MBFault:
import javax.xml.ws.WebFault;
@WebFault(name = "fault.MBFault",
targetNamespace = "fault")
public class MBFault extends Exception {
private String detail;
public MBFault(String message, String detail) {
super(message);
this.detail = detail;
}
public MBFault(String message, String detail, Throwable cause) {
super(message, cause);
this.detail = detail;
}
public String getDetail() {
return detail;
}
}
基于服务器我创建了一个WSDL,从我创建的WSDL客户端(wsimport -s myPackage ... wsdl)。 如何在客户端设置MBFault的路径?如果我想,那MBFault.java保存在包“fault”中,而所有其他包保存在客户端的“otherClasses”中。请帮帮我。
答案 0 :(得分:0)
您可能需要进行以下更改:
@WebFault(
name = "MBFault",
targetNamespace = "http://fault"
)