Package test

Source Code of test.put

package test;

import java.io.*;
import org.apache.axis.*;
import org.apache.axis.client.ServiceClient;
import org.apache.axis.transport.http.HTTPTransport ;
import org.apache.axis.utils.*;

/**
* A convenient little test program which will send a message as is to
* the server.  Useful for debugging interoperability problems or
* handling of ill-formed messages that are hard to reproduce programmatically.
*
* Accepts the standard options, followed by a list of files containing
* the contents to be sent.
*/
class put {
    static void main(String[] args) throws Exception {
        Options opts = new Options(args);
        String action = opts.isValueSet('a');

        ServiceClient sc = new ServiceClient(opts.getURL());
        if (action != null) sc.set(HTTPTransport.ACTION, action);
 
        args = opts.getRemainingArgs();
        for (int i=0; i<args.length; i++) {
            FileInputStream stream = new FileInputStream(new File(args[i]));
            sc.setRequestMessage(new Message(stream));
   
            sc.invoke();
       
            MessageContext mc = sc.getMessageContext();
            System.out.println(mc.getResponseMessage().getAsString());
        }
    }
}
TOP

Related Classes of test.put

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.