Last active
August 29, 2015 14:05
-
-
Save rcaneppele/6587fc79060a00c1fa1c to your computer and use it in GitHub Desktop.
JAX-WS - SOAP-Fault
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FaultBean implements Serializable { | |
private static final long serialVersionUID = 1L; | |
@XmlElement(name="faultcode") | |
private String faultCode; | |
@XmlElement(name="faultstring") | |
private String faultString; | |
public FaultBean() { | |
} | |
public FaultBean(String faultCode, String faultString) { | |
super(); | |
this.faultCode = faultCode; | |
this.faultString = faultString; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@WebFault | |
public class MyException extends Exception { | |
private static final long serialVersionUID = 1L; | |
private FaultBean bean; | |
public MyException(String message, FaultBean bean) { | |
super(message); | |
this.bean = bean; | |
} | |
public MyException(String message, FaultBean bean, Throwable cause) { | |
super(message, cause); | |
this.bean = bean; | |
} | |
public FaultBean getFaultInfo() { | |
return bean; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment