1 package test; 2 3 import org.apache.axis.Message; 4 import org.apache.axis.client.Call; 5 import org.apache.axis.client.Service; 6 import org.apache.axis.utils.Options; 7 8 import java.io.File ; 9 import java.io.FileInputStream ; 10 11 19 class put { 20 static void main(String [] args) throws Exception { 21 Options opts = new Options(args); 22 String action = opts.isValueSet('a'); 23 24 Service service = new Service(); 25 Call call = (Call) service.createCall(); 26 27 call.setTargetEndpointAddress( new java.net.URL (opts.getURL()) ); 28 if (action != null ) { 29 call.setUseSOAPAction( true ); 30 call.setSOAPActionURI( action ); 31 } 32 33 args = opts.getRemainingArgs(); 34 for (int i=0; i<args.length; i++) { 35 FileInputStream stream = new FileInputStream (new File (args[i])); 36 call.setRequestMessage(new Message(stream)); 37 38 call.invoke(); 39 40 System.out.println(call.getResponseMessage().getSOAPPartAsString()); 41 } 42 } 43 } 44 | Popular Tags |