Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.apache.axis2.transport.xmpp.sample;
 
public class XMPPSampleClient {
    public static void main(String[] args) {
	}
	private static void invokeTimeService() {
		String endPointUrl = "xmpp://synapse.demo.0@gmail.com/" + "TimeService";
		EndpointReference targetEPR = new EndpointReference(endPointUrl);
		try {
            ConfigurationContext ctx =
            ConfigurationContextFactory.createConfigurationContextFromURIs(
                    XMPPSampleClient.class.getResource("axis2.xml"), null);
			OMElement payload = getPayload();
			Options options = new Options();
			options.setProperty(."synapse.demo.0");
			options.setTo(targetEPR);
			options.setAction("urn:getServerTime");
			ServiceClient sender = new ServiceClient(ctx,null);
			sender.setOptions(options);
			OMElement result = sender.sendReceive(payload);
			XMLPrettyPrinter.prettify(result.);
catch (Exception e) {
		}
	}
	private static OMElement getPayload() {
		OMFactory fac = OMAbstractFactory.getOMFactory();
				"http://example.xmpp.transports.axis2.org/example1""example1");
        return fac.createOMElement("getServerTime"omNs);
	}
New to GrepCode? Check out our FAQ X