Package org.apache.sandesha

Examples of org.apache.sandesha.SandeshaContext


        try {

            Service service = new Service();
            Call call = (Call) service.createCall();

            SandeshaContext ctx = new SandeshaContext();

            ctx.setToURL("http://soap.systinet.net:6064/Service");
            ctx.setAcksToURL("http://" + sourceHost + ":" + sourcePort + "/axis/services/RMService");
            ctx.setFromURL("http://" + sourceHost + ":" + sourcePort + "/axis/services/RMService");
            ctx.setFaultToURL("http://" + sourceHost + ":" + sourcePort + "/axis/services/RMService");

            ctx.initCall(call, targetURL, "urn:wsrm:Ping", Constants.ClientProperties.IN_ONLY);

            call.setOperationName(new QName("http://tempuri.org/", "Ping"));

            call.addParameter("arg1", XMLType.XSD_STRING, ParameterMode.IN);

            call.invoke(new Object[]{"Ping Message Number One"});

            call.invoke(new Object[]{"Ping Message Number Two"});
            ctx.setLastMessage(call);
            call.invoke(new Object[]{"Ping Message Number Three"});

            ctx.endSequence();

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



            Service service = new Service();
            Call call = (Call) service.createCall();

            SandeshaContext ctx = new SandeshaContext(true);
            ctx.setSourceURL(bean.getSourceURL());

            configureContext(ctx, bean);
            ctx.initCall(call, target, "urn:wsrm:echoString", Constants.ClientProperties.IN_OUT);

            for (int i = 1; i <= messages; i++) {
                if (i == messages) {
                    ctx.setLastMessage(call);
                }

                SOAPEnvelope env = call.invoke(new Message(getEchoSOAPEnvelope(i, seq)));
                if (log.isDebugEnabled()) {
                    log.debug("Got response from server " + env.toString());
                }
            }

            ctx.endSequence();

        } catch (Exception e) {
            if (callback != null)
                callback.onError(e);
            log.error(e);
View Full Code Here


            Service service = new Service();
            Call call = (Call) service.createCall();

            SandeshaContext ctx = new SandeshaContext();

            ctx.setToURL("http://131.107.153.195/SecureReliableMessaging/ReliableOneWayDual.svc");
            ctx.setFromURL("http://" + sourceHost + ":" + sourcePort + "/axis/services/RMService");
            ctx.setAcksToURL("http://" + sourceHost + ":" + sourcePort + "/axis/services/RMService");
            ctx.setFaultToURL("http://" + sourceHost + ":" + sourcePort + "/axis/services/RMService");
            ctx.setReplyToURL("http://" + sourceHost + ":" + sourcePort + "/axis/services/RMService");

            ctx.initCall(call, targetURL, "urn:wsrm:Ping", Constants.ClientProperties.IN_ONLY);

            call.setOperationName("Ping");
            call.invoke(new Message(getSOAPEnvelope(1)));
            call.invoke(new Message(getSOAPEnvelope(2)));
            ctx.setLastMessage(call);
            call.invoke(new Message(getSOAPEnvelope(3)));

            ctx.endSequence();

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

        try {
            Service service = new Service();
            Call call = (Call) service.createCall();

            SandeshaContext ctx = new SandeshaContext();


            ctx.setToURL("http://wsi.alphaworks.ibm.com:8080/wsrm/services/rmDemos");
            ctx.setFaultToURL("http://" + sourceHost + ":" + sourcePort + "/axis/services/RMService");
            ctx.setAcksToURL("http://" + sourceHost + ":" + sourcePort + "/axis/services/RMService");
            ctx.setFromURL("http://" + sourceHost + ":" + sourcePort + "/axis/services/RMService");
            ctx.setReplyToURL("http://" + sourceHost + ":" + sourcePort + "/axis/services/RMService");

            ctx.initCall(call, targetURL, "urn:wsrm:echoString", Constants.ClientProperties.IN_OUT);

            call.setOperationName(new QName("http://tempuri.org/", "echoString"));

            call.addParameter("Text", XMLType.XSD_STRING, ParameterMode.IN);
            call.addParameter("Sequence", XMLType.XSD_STRING, ParameterMode.IN);
            call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);

            String ret = (String) call.invoke(new Object[]{"Sandesha Echo 1", str});
            System.out.println("The Response for First Messsage is  :" + ret);

            ret = (String) call.invoke(new Object[]{"Sandesha Echo 2", str});
            System.out.println("The Response for Second Messsage is  :" + ret);

            ctx.setLastMessage(call);
            ret = (String) call.invoke(new Object[]{"Sandesha Echo 3", str});
            System.out.println("The Response for Third Messsage is  :" + ret);

            ctx.endSequence();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

        String acksTo = getAcksTo(call);
        String to = getTo(call);
        String faultTo = getFaultTo(call);
        boolean sendOffer = getOffer(call);
        String key = getKey(call);
        SandeshaContext ctx = getCtx(call);

        try {
            sourceURL = getSourceURL(call);
        } catch (Exception e) {
            throw new AxisFault(e.getMessage());
View Full Code Here

     * @param call
     * @return
     */
    private static long getMessageNumber(Call call) {
        Object temp = call.getProperty(Constants.ClientProperties.MSG_NUMBER);
        SandeshaContext ctx = (SandeshaContext) call.getProperty(Constants.CONTEXT);
        long msgNo = ctx.getMessageNumber();
        if (temp == null) {
            ctx.setMessageNumber(++msgNo);
        } else {
            msgNo = ((Long) call.getProperty(Constants.ClientProperties.MSG_NUMBER)).longValue();

        }

View Full Code Here


            Service service = new Service();
            Call call = (Call) service.createCall();

            SandeshaContext ctx = new SandeshaContext(Constants.SYNCHRONOUS);
            ctx.initCall(call, targetURL, "urn:wsrm:Ping",
                    Constants.ClientProperties.IN_ONLY);

            call.setOperationName(new QName("http://tempuri.org/", "Ping"));
            call.addParameter("arg1", XMLType.XSD_STRING, ParameterMode.IN);

            call.invoke(new Object[]{"Ping Message Number One"});
            call.invoke(new Object[]{"Ping Message Number Two"});
            ctx.setLastMessage(call);
            call.invoke(new Object[]{"Ping Message Number Three"});

            RMReport report = ctx.endSequence();


            if (report != null) {
                System.out.println("\n***********Printing RM Report***********");
                System.out.println("Is all messages acked     - " + report.isAllAcked());
View Full Code Here


            Service service = new Service();
            Call call = (Call) service.createCall();

            SandeshaContext ctx = new SandeshaContext();

            ctx.setAcksToURL(Constants.WSA.NS_ADDRESSING_ANONYMOUS);
            ctx.setReplyToURL("http://127.0.0.1:" + defaultClientPort + "/axis/services/RMService");
            ctx.initCall(call, targetURL, "urn:wsrm:echoString", Constants.ClientProperties.IN_OUT);

            call.setOperationName(new QName("http://tempuri.org/", "echoString"));

            call.addParameter("arg1", XMLType.XSD_STRING, ParameterMode.IN);
            call.addParameter("arg2", XMLType.XSD_STRING, ParameterMode.IN);
            call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);

            String ret = (String) call.invoke(new Object[]{"Sandesha Echo 1", str});
            System.out.println("The Response for First Messsage is  :" + ret);

            ret = (String) call.invoke(new Object[]{"Sandesha Echo 2", str});
            System.out.println("The Response for Second Messsage is  :" + ret);

            //For last message.
            ctx.setLastMessage(call);
            ret = (String) call.invoke(new Object[]{"Sandesha Echo 3", str});
            System.out.println("The Response for Third Messsage is  :" + ret);

            RMReport report = ctx.endSequence();


            if (report != null) {
                System.out.println("\n***********Printing RM Report***********");
                System.out.println("Is all messages acked     - " + report.isAllAcked());
View Full Code Here

            String str = uuidGen.nextUUID();

            Service service = new Service();
            Call call = (Call) service.createCall();

            SandeshaContext ctx = new SandeshaContext();

            ctx.setAcksToURL("http://127.0.0.1:" + defaultClientPort + "/axis/services/RMService");
            ctx.setReplyToURL("http://127.0.0.1:" + defaultClientPort + "/axis/services/RMService");
            ctx.setSendOffer(true);
            ctx.initCall(call, targetURL, "urn:wsrm:echoString", Constants.ClientProperties.IN_OUT);

            call.setOperationName(new QName("http://tempuri.org/", "echoString"));

            call.addParameter("arg1", XMLType.XSD_STRING, ParameterMode.IN);
            call.addParameter("arg2", XMLType.XSD_STRING, ParameterMode.IN);
            call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);

            String ret = (String) call.invoke(new Object[]{"Sandesha Echo 1", str});
            System.out.println("The Response for First Messsage is  :" + ret);

            ret = (String) call.invoke(new Object[]{"Sandesha Echo 2", str});
            System.out.println("The Response for Second Messsage is  :" + ret);

            ctx.setLastMessage(call);
            ret = (String) call.invoke(new Object[]{"Sandesha Echo 3", str});
            System.out.println("The Response for Third Messsage is  :" + ret);

            RMReport report = ctx.endSequence();


            if (report != null) {
                System.out.println("\n***********Printing RM Report***********");
                System.out.println("Is all messages acked     - " + report.isAllAcked());
View Full Code Here

        try {

            Service service = new Service();
            Call call = (Call) service.createCall();

            SandeshaContext ctx = new SandeshaContext();
            ctx.setAcksToURL("http://127.0.0.1:" + defaultClientPort + "/axis/services/RMService");
            ctx.setReplyToURL("http://127.0.0.1:" + defaultClientPort + "/axis/services/RMService");
            ctx.initCall(call, targetURL, "urn:wsrm:ping", Constants.ClientProperties.IN_ONLY);

            call.setOperationName(new QName("http://tempuri.org", "Ping"));
            call.addParameter("Text", XMLType.XSD_STRING, ParameterMode.IN);

            call.invoke(new Object[]{"Ping Message Number One"});
            call.invoke(new Object[]{"Ping Message Number Two"});
            ctx.setLastMessage(call);
            call.invoke(new Object[]{"Ping Message Number Three"});

            RMReport report = ctx.endSequence();


            System.out.println("\n***********Printing RM Report***********");
            System.out.println("Is all messages acked     - " + report.isAllAcked());
            System.out.println("****************************************\n");
 
View Full Code Here

TOP

Related Classes of org.apache.sandesha.SandeshaContext

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.