1 17 18 package org.apache.sandesha.interop; 19 20 import org.apache.axis.client.Call; 21 import org.apache.axis.client.Service; 22 import org.apache.axis.encoding.XMLType; 23 import org.apache.sandesha.Constants; 24 import org.apache.sandesha.SandeshaContext; 25 26 import javax.xml.namespace.QName ; 27 import javax.xml.rpc.ParameterMode ; 28 29 34 public class IBMAsyncPing { 35 36 private static String targetURL = "http://127.0.0.1:8080/wsrm/services/rmDemos"; 37 private static String sourceHost = "192.248.18.51"; private static String sourcePort = "9070"; 41 public static void main(String [] args) { 42 System.out.println("Client started...... Asynchronous Ping - IBM"); 43 try { 44 45 Service service = new Service(); 46 Call call = (Call) service.createCall(); 47 48 SandeshaContext ctx = new SandeshaContext(); 49 50 ctx.setToURL("http://wsi.alphaworks.ibm.com:8080/wsrm/services/rmDemos"); 51 ctx.setFaultToURL("http://" + sourceHost + ":" + sourcePort + "/axis/services/RMService"); 52 ctx.setAcksToURL("http://" + sourceHost + ":" + sourcePort + "/axis/services/RMService"); 53 ctx.setFromURL("http://" + sourceHost + ":" + sourcePort + "/axis/services/RMService"); 54 55 ctx.initCall(call, targetURL, "urn:wsrm:Ping", Constants.ClientProperties.IN_ONLY); 56 57 call.setOperationName(new QName ("http://tempuri.org/", "Ping")); 58 59 call.addParameter("Text", XMLType.XSD_STRING, ParameterMode.IN); 60 61 call.invoke(new Object []{"Ping Message Number One"}); 62 call.invoke(new Object []{"Ping Message Number Two"}); 63 ctx.setLastMessage(call); 64 call.invoke(new Object []{"Ping Message Number Three"}); 65 66 ctx.endSequence(); 67 68 } catch (Exception e) { 69 e.printStackTrace(); 70 } 71 } 72 } 73 | Popular Tags |