1 17 package org.apache.sandesha.interop; 18 19 import org.apache.axis.client.Call; 20 import org.apache.axis.client.Service; 21 import org.apache.axis.encoding.XMLType; 22 import org.apache.sandesha.Constants; 23 import org.apache.sandesha.SandeshaContext; 24 25 import javax.xml.namespace.QName ; 26 import javax.xml.rpc.ParameterMode ; 27 28 34 public class SystinetSyncPing { 35 36 private static String targetURL = "http://127.0.0.1:6064/Service"; 37 38 public static void main(String [] args) { 39 System.out.println("Client started...... Synchronous "); 40 try { 41 42 Service service = new Service(); 43 Call call = (Call) service.createCall(); 44 45 SandeshaContext ctx = new SandeshaContext(Constants.SYNCHRONOUS); 46 47 ctx.setToURL("http://soap.systinet.net:6064/Service"); 48 ctx.initCall(call, targetURL, "urn:wsrm:Ping", Constants.ClientProperties.IN_ONLY); 49 50 call.setTargetEndpointAddress(targetURL); 51 call.setOperationName(new QName ("http://tempuri.org/", "Ping")); 52 53 54 call.addParameter("arg1", XMLType.XSD_STRING, ParameterMode.IN); 55 56 call.invoke(new Object []{"Ping Message Number One"}); 57 call.invoke(new Object []{"Ping Message Number Two"}); 58 ctx.setLastMessage(call); 59 call.invoke(new Object []{"Ping Message Number Three"}); 60 61 ctx.endSequence(); 62 63 } catch (Exception e) { 64 e.printStackTrace(); 65 } 66 } 67 } | Popular Tags |