Search in sources :

Example 1 with DoubleItResponse

use of org.example.schema.doubleit.DoubleItResponse in project cxf by apache.

the class DoubleIt3Impl method doubleIt3.

@Override
public DoubleItResponse doubleIt3(DoubleIt3 parameters, byte[] attachment) throws DoubleItFault {
    int numberToDouble = parameters.getNumberToDouble();
    if (numberToDouble == 0) {
        throw new DoubleItFault("0 can't be doubled!");
    }
    if (!Arrays.equals(attachment, "12345".getBytes())) {
        throw new DoubleItFault("Unexpected attachment value!");
    }
    DoubleItResponse response = new DoubleItResponse();
    response.setDoubledNumber(numberToDouble * 2);
    return response;
}
Also used : DoubleItResponse(org.example.schema.doubleit.DoubleItResponse) DoubleItFault(org.example.contract.doubleit.DoubleItFault)

Example 2 with DoubleItResponse

use of org.example.schema.doubleit.DoubleItResponse in project cxf by apache.

the class DoubleIt3Impl method doubleIt3.

@Override
public DoubleItResponse doubleIt3(DoubleIt3 parameters, byte[] attachment) throws DoubleItFault {
    int numberToDouble = parameters.getNumberToDouble();
    if (numberToDouble == 0) {
        throw new DoubleItFault("0 can't be doubled!");
    }
    if (!Arrays.equals(attachment, "12345".getBytes())) {
        throw new DoubleItFault("Unexpected attachment value!");
    }
    DoubleItResponse response = new DoubleItResponse();
    response.setDoubledNumber(numberToDouble * 2);
    return response;
}
Also used : DoubleItResponse(org.example.schema.doubleit.DoubleItResponse) DoubleItFault(org.example.contract.doubleit.DoubleItFault)

Aggregations

DoubleItFault (org.example.contract.doubleit.DoubleItFault)2 DoubleItResponse (org.example.schema.doubleit.DoubleItResponse)2