Search in sources :

Example 1 with Ping

use of org.apache.handler_test.types.Ping in project cxf by apache.

the class TestHandler method handleMessage.

public boolean handleMessage(T ctx) {
    methodCalled("handleMessage");
    printHandlerInfo("handleMessage", isOutbound(ctx));
    boolean outbound = (Boolean) ctx.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
    boolean ret = getHandleMessageRet();
    if (!isServerSideHandler()) {
        return true;
    }
    try {
        verifyJAXWSProperties(ctx);
    } catch (PingException e) {
        e.printStackTrace();
        throw new ProtocolException(e);
    }
    Object obj = ctx.getMessage().getPayload(jaxbCtx);
    if (obj instanceof Ping || obj instanceof PingResponse) {
        ret = handlePingMessage(outbound, ctx);
    } else if (obj instanceof PingWithArgs) {
        ret = handlePingWithArgsMessage(outbound, ctx);
    }
    return ret;
}
Also used : ProtocolException(javax.xml.ws.ProtocolException) PingWithArgs(org.apache.handler_test.types.PingWithArgs) Ping(org.apache.handler_test.types.Ping) PingResponse(org.apache.handler_test.types.PingResponse) PingException(org.apache.handler_test.PingException)

Example 2 with Ping

use of org.apache.handler_test.types.Ping in project cxf by apache.

the class TestHandler method addHandlerId.

private void addHandlerId(LogicalMessage msg, T ctx, boolean outbound) {
    Object obj = msg.getPayload(jaxbCtx);
    if (obj instanceof PingResponse) {
        PingResponse origResp = (PingResponse) obj;
        PingResponse newResp = new PingResponse();
        newResp.getHandlersInfo().addAll(origResp.getHandlersInfo());
        newResp.getHandlersInfo().add(getHandlerId());
        msg.setPayload(newResp, jaxbCtx);
    } else if (obj instanceof Ping || obj instanceof PingWithArgs) {
        getHandlerInfoList(ctx).add(getHandlerId());
    }
}
Also used : PingWithArgs(org.apache.handler_test.types.PingWithArgs) Ping(org.apache.handler_test.types.Ping) PingResponse(org.apache.handler_test.types.PingResponse)

Aggregations

Ping (org.apache.handler_test.types.Ping)2 PingResponse (org.apache.handler_test.types.PingResponse)2 PingWithArgs (org.apache.handler_test.types.PingWithArgs)2 ProtocolException (javax.xml.ws.ProtocolException)1 PingException (org.apache.handler_test.PingException)1