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 35 public class IBMSyncPing { 36 37 private static String targetURL = "http://127.0.0.1:8080/wsrm/services/rmDemos"; 38 39 public static void main(String [] args) { 40 System.out.println("Client started...... Synchronous Ping - IBM"); 41 try { 42 43 Service service = new Service(); 44 Call call = (Call) service.createCall(); 45 46 SandeshaContext ctx = new SandeshaContext(Constants.SYNCHRONOUS); 47 48 ctx.setToURL("http://wsi.alphaworks.ibm.com:8080/wsrm/services/rmDemos"); 49 ctx.setAcksToURL(Constants.WSA.NS_ADDRESSING_ANONYMOUS); 50 ctx.initCall(call, targetURL, "urn:wsrm:Ping", Constants.ClientProperties.IN_ONLY); 51 52 call.setOperationName(new QName ("http://tempuri.org/", "Ping")); 53 54 call.addParameter("Text", 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(); 66 } 67 } 68 } 69 | Popular Tags |