Package javax.xml.ws

Examples of javax.xml.ws.LogicalMessage


            public boolean handleFault(LogicalMessageContext messageContext) {
                return true;
            }

            public boolean handleMessage(LogicalMessageContext messageContext) {
                LogicalMessage msg = messageContext.getMessage();
                AddNumbersResponse resp = new AddNumbersResponse();
                resp.setReturn(11);
                msg.setPayload(resp, null);
                return false;
            }
        });
        HandlerChainInvoker invoker1 = new HandlerChainInvoker(list);
View Full Code Here



    private boolean handlePingWithArgsMessage(boolean outbound, T ctx) {

       
        LogicalMessage msg = ctx.getMessage();
        Object payload = msg.getPayload(jaxbCtx);
        addHandlerId(ctx.getMessage(), ctx, outbound);

        boolean ret = true;
        if (payload instanceof PingWithArgs) {
            String arg = ((PingWithArgs)payload).getHandlersCommand();
           
            StringTokenizer strtok = new StringTokenizer(arg, " ");
            String hid = strtok.nextToken();
            String direction = strtok.nextToken();
            String command = strtok.nextToken();
           
            if (outbound) {
                return ret;
            }

            if (getHandlerId().equals(hid)
                && "inbound".equals(direction)) {
               
                if ("stop".equals(command)) {
                    PingResponse resp = new PingResponse();
                    getHandlerInfoList(ctx).add(getHandlerId());
                    resp.getHandlersInfo().addAll(getHandlerInfoList(ctx));
                    msg.setPayload(resp, jaxbCtx);
                    ret = false;
                } else if ("throw".equals(command)) {
                    throwException(strtok.nextToken());
                }
            }
View Full Code Here

        }
    }

    private boolean handlePingMessage(boolean outbound, T ctx) {

        LogicalMessage msg = ctx.getMessage();
        addHandlerId(msg, ctx, outbound);
        return handleMessageRet;
    }
View Full Code Here

            boolean outbound = (Boolean)messageContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);

            if (outbound) {
                // get the LogicalMessage from our context
                //
                LogicalMessage msg = messageContext.getMessage();

                // check the payload, if its an AddNumbers request, we'll intervene
                //
                JAXBContext jaxbContext = JAXBContext.newInstance(AddNumbers.class);
                Object payload = msg.getPayload(jaxbContext);

                if (payload instanceof AddNumbers) {
                    AddNumbers req = (AddNumbers)payload;

                    // now, if the arguments are small, let's do the calculation here
                    //
                    int a = req.getArg0();
                    int b = req.getArg1();

                    if (isSmall(a) && isSmall(b)) {
                        int answer = a + b;

                        //System.out.printf("SmallNumberHandler addNumbers(%d, %d) == %d\n", a, b, answer);
                        // ok, we've done the calculation, so build the
                        // response and set it as the payload of the message
                        AddNumbersResponse resp = new AddNumbersResponse();
                        resp.setReturn(answer);
                        msg.setPayload(resp, jaxbContext);

                        // finally, return false, indicating that request
                        // processing stops here and our answer will be
                        // returned to the client
                        return false;
View Full Code Here

            public boolean handleMessage(LogicalMessageContext ctx) {
                super.handleMessage(ctx);
                try {
                    Boolean outbound = (Boolean)ctx.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
                    if (!outbound) {
                        LogicalMessage msg = ctx.getMessage();
                        Source source = msg.getPayload();
                        assertNotNull(source);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                    fail(e.toString());
View Full Code Here

            public boolean handleMessage(LogicalMessageContext ctx) {
                super.handleMessage(ctx);
                try {
                    Boolean outbound = (Boolean)ctx.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
                    if (outbound) {
                        LogicalMessage msg = ctx.getMessage();
                        assertNotNull("logical message is null", msg);
                        JAXBContext jaxbCtx = JAXBContext.newInstance(PackageUtils
                            .getPackageName(PingOneWay.class));
                        PingResponse resp = new PingResponse();
                        resp.getHandlersInfo().add(clientHandlerMessage);

                        msg.setPayload(resp, jaxbCtx);
                        return false;
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                    fail(e.toString());
View Full Code Here

            public boolean handleMessage(LogicalMessageContext ctx) {
                super.handleMessage(ctx);
                try {
                    Boolean outbound = (Boolean)ctx.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
                    if (outbound) {
                        LogicalMessage msg = ctx.getMessage();
                        assertNotNull("logical message is null", msg);
                        JAXBContext jaxbCtx = JAXBContext.newInstance(PackageUtils
                            .getPackageName(PingOneWay.class));
                        PingResponse resp = new PingResponse();
                        resp.getHandlersInfo().add(clientHandlerMessage);

                        msg.setPayload(resp, jaxbCtx);
                    }

                } catch (Exception e) {
                    e.printStackTrace();
                    fail(e.toString());
View Full Code Here

            public boolean handleFault(LogicalMessageContext ctx) {
                super.handleFault(ctx);
                try {
                    Boolean outbound = (Boolean)ctx.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
                    if (!outbound) {
                        LogicalMessage msg = ctx.getMessage();
                        Source source = msg.getPayload();
                        assertNotNull(source);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                    fail(e.toString());
View Full Code Here

            public boolean handleFault(LogicalMessageContext messageContext) {
                return true;
            }

            public boolean handleMessage(LogicalMessageContext messageContext) {
                LogicalMessage msg = messageContext.getMessage();
                AddNumbersResponse resp = new AddNumbersResponse();
                resp.setReturn(11);
                msg.setPayload(resp, null);
                return false;
            }
        });
        HandlerChainInvoker invoker1 = new HandlerChainInvoker(list);
View Full Code Here

            public boolean handleMessage(LogicalMessageContext ctx) {
                super.handleMessage(ctx);
                try {
                    Boolean outbound = (Boolean)ctx.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
                    if (!outbound) {
                        LogicalMessage msg = ctx.getMessage();
                        Source source = msg.getPayload();
                        assertNotNull(source);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                    fail(e.toString());
View Full Code Here

TOP

Related Classes of javax.xml.ws.LogicalMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.