Search in sources :

Example 1 with SomeFault

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;
}
Also used : DoSomethingFault(org.apache.schema_validation.DoSomethingFault) SomeFault(org.apache.schema_validation.types.SomeFault) SomeResponse(org.apache.schema_validation.types.SomeResponse)

Aggregations

DoSomethingFault (org.apache.schema_validation.DoSomethingFault)1 SomeFault (org.apache.schema_validation.types.SomeFault)1 SomeResponse (org.apache.schema_validation.types.SomeResponse)1