use of org.apache.schema_validation.types.SomeFault in project cxf by apache.
the class SchemaValidationImpl method doSomething.
@Override
public SomeResponse doSomething(SomeRequest in) throws DoSomethingFault {
SomeResponse response = new SomeResponse();
if (in.getId().equals("1234567890")) {
// invalid transaction id
response.setTransactionId("aaaaaaaaaaxxx");
} else if (in.getId().equals("9999999999")) {
SomeFault someFault = new SomeFault();
someFault.setErrorCode("1234");
throw new DoSomethingFault("Fault", someFault);
} else if (in.getId().equals("8888888888")) {
SomeFault someFault = new SomeFault();
someFault.setErrorCode("1");
throw new DoSomethingFault("Fault", someFault);
} else {
response.setTransactionId("aaaaaaaaaa");
}
return response;
}
Aggregations