ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(AXIS2_CLIENT_PATH,axis2_xml);
ServiceClient serviceClient = new ServiceClient (configContext,null);
Options clientOptions = new Options ();
EndpointReference toEPR = new EndpointReference (toAddress);
populateToEPRToRejectOffers(toEPR);
// clientOptions.setManageSession(true); // without this reference params wont go.
serviceClient.setTargetEPR(toEPR);
// clientOptions.setProperty(Options.COPY_PROPERTIES,new Boolean (true));
clientOptions.setTo(toEPR);
clientOptions.setAction("urn:wsrm:EchoString");
String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
String sequenceKey = "sequence4";
clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
clientOptions.setProperty(MessageContextConstants.TRANSPORT_URL,transportToEPR);
// clientOptions.setProperty(MessageContextConstants.CHUNKED,Constants.VALUE_FALSE); //uncomment this to send messages without chunking.
// clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI); //uncomment this to send messages in SOAP 1.2
// clientOptions.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,AddressingConstants.Submission.WSA_NAMESPACE);
clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION,Sandesha2Constants.SPEC_VERSIONS.v1_1); //uncomment this to send the messages according to the v1_1 spec.
clientOptions.setProperty(SandeshaClientConstants.OFFERED_SEQUENCE_ID,SandeshaUtil.getUUID()); //single characted offers are declined by the server
//You must set the following two properties in the request-reply case.
clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
clientOptions.setUseSeparateListener(true);
serviceClient.setOptions(clientOptions);
Callback callback1 = new TestCallback ("Callback 1");
serviceClient.sendReceiveNonBlocking(getEchoOMBlock("echo1",sequenceKey),callback1);