1 package org.apache.sandesha.interop; 2 3 import org.apache.axis.client.Call; 4 import org.apache.axis.client.Service; 5 import org.apache.axis.encoding.XMLType; 6 import org.apache.sandesha.Constants; 7 import org.apache.sandesha.SandeshaContext; 8 9 import javax.xml.namespace.QName ; 10 import javax.xml.rpc.ParameterMode ; 11 12 17 public class SystinetAsyncPing { 18 19 private static String targetURL = "http://127.0.0.1:6064/Service"; 20 private static String sourceHost = "192.248.18.51"; private static String sourcePort = "9070"; 24 public static void main(String [] args) { 25 System.out.println("Client started...... Synchronous "); 26 try { 27 28 Service service = new Service(); 29 Call call = (Call) service.createCall(); 30 31 SandeshaContext ctx = new SandeshaContext(); 32 33 ctx.setToURL("http://soap.systinet.net:6064/Service"); 34 ctx.setAcksToURL("http://" + sourceHost + ":" + sourcePort + "/axis/services/RMService"); 35 ctx.setFromURL("http://" + sourceHost + ":" + sourcePort + "/axis/services/RMService"); 36 ctx.setFaultToURL("http://" + sourceHost + ":" + sourcePort + "/axis/services/RMService"); 37 38 ctx.initCall(call, targetURL, "urn:wsrm:Ping", Constants.ClientProperties.IN_ONLY); 39 40 call.setOperationName(new QName ("http://tempuri.org/", "Ping")); 41 42 call.addParameter("arg1", XMLType.XSD_STRING, ParameterMode.IN); 43 44 call.invoke(new Object []{"Ping Message Number One"}); 45 46 call.invoke(new Object []{"Ping Message Number Two"}); 47 ctx.setLastMessage(call); 48 call.invoke(new Object []{"Ping Message Number Three"}); 49 50 ctx.endSequence(); 51 52 } catch (Exception e) { 53 e.printStackTrace(); 54 } 55 } 56 } | Popular Tags |