1 package jms.client.stub; 2 3 import org.apache.wsif.WSIFService; 4 import org.apache.wsif.WSIFServiceFactory; 5 import org.apache.wsif.WSIFException; 6 import java.rmi.RemoteException ; 7 import jms.client.stub.org.apache.xml.CheckAvailabilityPortType; 8 9 17 18 public class Run { 19 20 public static void main(String [] args) { 21 try { 22 23 if (args.length != 2) { 24 System.out.println( 25 "Usage: java jms.client.stub.Run <wsdl location> <zip code>"); 26 System.exit(1); 27 } 28 29 WSIFServiceFactory factory = WSIFServiceFactory.newInstance(); 31 32 WSIFService service = 34 factory.getService( 35 args[0], 36 null, 37 null, 38 "http://xml.apache.org/axis/wsif/samples/jms/ServiceAvailability", 39 "CheckAvailabilityPortType"); 40 CheckAvailabilityPortType stub = 42 (CheckAvailabilityPortType) service.getStub( 43 CheckAvailabilityPortType.class); 44 45 String serviceAvailable = stub.checkAvailability(args[1]); 48 System.out.println(serviceAvailable); 49 50 } catch (WSIFException we) { 51 System.out.println( 52 "Error while executing sample, received an exception from WSIF; details:"); 53 we.printStackTrace(); 54 } catch (RemoteException re) { 55 System.out.println( 56 "Error while executing sample, received an exception due to remote invocation; details:"); 57 re.printStackTrace(); 58 } 59 } 60 } 61 | Popular Tags |