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());