Package org.apache.axis.utils

Examples of org.apache.axis.utils.Options


     * that directory.
     */
    public static void main(String args[]) {
        try {

            Options opts = new Options(args);
            EchoAttachment echoattachment = new EchoAttachment(opts);

            args = opts.getRemainingArgs();
            int argpos=0;

            if(args == null || args.length == 0){
                System.err.println("Need a file or directory argument.");
                System.exit(8);
View Full Code Here


     * that directory.
     */
    public static void main(String args[]) {
        try {

            Options opts = new Options(args);
            TestRef echoattachment = new TestRef(opts);

            args = opts.getRemainingArgs();
            int argpos=0;

            if (echoattachment.testit()) {
                System.out.println("Attachments sent and received ok!");
                System.exit(0);
View Full Code Here

public class GetQuote {
    public  String symbol ;
   
  // helper function; does all the real work
    public float getQuote (String args[]) throws Exception {
      Options opts = new Options( args );

      args = opts.getRemainingArgs();

      if ( args == null ) {
        System.err.println( "Usage: GetQuote <symbol>" );
        System.exit(1);
      }

      symbol = args[0] ;

      // useful option for profiling - perhaps we should remove before
      // shipping?
      String countOption = opts.isValueSet('c');
      int count=1;
      if ( countOption != null) {
          count=Integer.valueOf(countOption).intValue();
          System.out.println("Iterating " + count + " times");
      }

      URL url = new URL(opts.getURL());
      String user = opts.getUser();
      String passwd = opts.getPassword();

      Service  service = new Service();

      Float res = new Float(0.0F);
      for (int i=0; i<count; i++) {
View Full Code Here

            "  <parameter name=\"className\" value=\"org.apache.axis.utils.Admin\"/>\n" +
            " </service>\n" +
            "</deployment>";

    public static void main(String args[]) throws Exception {
        Options opts = new Options( args );

        // first check if we should print usage
        if ((opts.isFlagSet('?') > 0) || (opts.isFlagSet('h') > 0))
            printUsage();

        HashMap connectorMap = SimpleJMSListener.createConnectorMap(opts);
        HashMap cfMap = SimpleJMSListener.createCFMap(opts);
        String destination = opts.isValueSet('d');
        String username = opts.getUser();
        String password = opts.getPassword();
        // create the jms listener
        SimpleJMSListener listener = new SimpleJMSListener(connectorMap,
                                                           cfMap,
                                                           destination,
                                                           username,
                                                           password,
                                                           false);
        listener.start();

        args = opts.getRemainingArgs();
        if ( args == null || args.length == 0)
            printUsage();

        Service  service = new Service(new XMLStringProvider(wsdd));
View Full Code Here

     * Arguments are of the form:
     *   -h localhost -p 8080 -s /soap/servlet/rpcrouter
     * -h indicats the host
     */
    public static void main(String args[]) throws Exception {
        Options opts = new Options(args);

        boolean testPerformance = opts.isFlagSet('k') > 0;
        boolean allTests = opts.isFlagSet('A') > 0;
        boolean onlyB    = opts.isFlagSet('b') > 0;
        boolean testMode = opts.isFlagSet('t') > 0;

        // set up tests so that the results are sent to System.out
        TestClient client;

        if (testPerformance) {
            client = new TestClient(testMode) {
               public void verify(String method, Object sent, Object gotBack) {
               }
            };
        } else {
            client = new TestClient(testMode) {
            public void verify(String method, Object sent, Object gotBack) {
                String message;
                if (this.equals(sent, gotBack)) {
                    message = "OK";
                } else {
                    if (gotBack instanceof Exception) {
                        if (gotBack instanceof AxisFault) {
                            message = "Fault: " +
                                ((AxisFault)gotBack).getFaultString();
                        } else {
                            StringWriter sw = new StringWriter();
                            PrintWriter pw = new PrintWriter(sw);
                            message = "Exception: ";
                            ((Exception)gotBack).printStackTrace(pw);
                            message += sw.getBuffer().toString();
                        }
                    } else {
                        message = "Fail:" + gotBack + " expected " + sent;
                    }
                }
                // Line up the output
                String tab = "";
                int l = method.length();
                while (l < 25) {
                    tab += " ";
                    l++;
                }
                System.out.println(method + tab + " " + message);
            }
        };
        }

        // set up the call object
        client.setURL(opts.getURL());

        if (testPerformance) {
            long startTime = System.currentTimeMillis();
            for (int i = 0; i < 10; i++) {
                if (allTests) {
View Full Code Here

     */

    public String process(String[] args) throws Exception {
        StringBuffer sb = new StringBuffer();

        Options opts = new Options( args );
        opts.setDefaultURL("http://localhost:8080/axis/services/AdminService");

        if (opts.isFlagSet('d') > 0) {
            // Set logger properties... !!!
        }

        args = opts.getRemainingArgs();

        if ( args == null ) {
            log.info(Messages.getMessage("usage00","AdminClient xml-files | list"));
            return null;
        }
View Full Code Here

        //Service service=new Service(new URL("file:ElementService.wsdl"),sqn);
        Service service = new Service(new URL(sURL+"?wsdl"),sqn);
        Call    call    = (Call) service.createCall( pqn, "echoElement" );

        Options opts = new Options(args);
        opts.setDefaultURL( call.getTargetEndpointAddress() );
        call.setTargetEndpointAddress( new URL(opts.getURL()) );

        Element elem = XMLUtils.newDocument(bais).getDocumentElement();

        elem = (Element) call.invoke( new Object[] { "a string", elem } );
        return( XMLUtils.ElementToString( elem ) );
View Full Code Here

            "  <parameter name=\"className\" value=\"org.apache.axis.utils.Admin\"/>\n" +
            " </service>\n" +
            "</deployment>";

    public static void main(String args[]) throws Exception {
        Options opts = new Options( args );

        // first check if we should print usage
        if ((opts.isFlagSet('?') > 0) || (opts.isFlagSet('h') > 0)) {
            printUsage();
        }

        // create the jms listener
        SimpleJMSListener listener = new SimpleJMSListener(opts);
        listener.start();

        args = opts.getRemainingArgs();
        if ( args == null ) {
            printUsage();
        }

        int numArgs = args.length;
        String[] symbols = new String[numArgs];
        for (int i = 0; i < numArgs; i++) {
            symbols[i] = args[i];
        }

        Service  service = new Service(new XMLStringProvider(wsdd));

        HashMap cfProps = new HashMap();
        cfProps.put(SonicConstants.BROKER_URL, opts.isValueSet('b'));
        cfProps.put(SonicConstants.DEFAULT_USERNAME, opts.getUser());
        cfProps.put(SonicConstants.DEFAULT_PASSWORD, opts.getPassword());

        // do we have a jndi name?
        String jndiName = opts.isValueSet('n');
        if (jndiName != null) {
            // w/ a jndi name, we can get the appropriate connection factory
            cfProps.put(JMSConstants.CONNECTION_FACTORY_JNDI_NAME, jndiName);
        } else {
            // w/o a jndi name, we default to using the Sonic-specific method
            // for creating a connection factory, which is by specifying the
            // appropriate connection factory class from SonicConstants.java

            // topics or queues?
            String cf = null;
            if (opts.isFlagSet('t') > 0) {
                cf = SonicConstants.TCF_CLASS;
            } else {
                cf = SonicConstants.QCF_CLASS;
            }
            cfProps.put(JMSConstants.CONNECTION_FACTORY_CLASS, cf);
View Full Code Here

        connector.shutdown();
    }

    public static void main(String[] args) throws Exception
    {
        Options options = new Options(args);

        // first check if we should print usage
        if ((options.isFlagSet('?') > 0) || (options.isFlagSet('h') > 0)) {
            printUsage();
        }

        SimpleJMSListener listener = new SimpleJMSListener(options);
    }
View Full Code Here

     */
    public static void main(String args[]) {

        SimpleAxisServer sas = new SimpleAxisServer();

        Options opts = null;
        try {
            opts = new Options(args);
        } catch (MalformedURLException e) {
            log.error(Messages.getMessage("malformedURLException00"), e);
            return;
        }

        try {
            doThreads = (opts.isFlagSet('t') > 0);

            int port = opts.getPort();
            ServerSocket ss = null;
            // Try five times
            for (int i = 0; i < 5; i++) {
                try {
                    ss = new ServerSocket(port);
View Full Code Here

TOP

Related Classes of org.apache.axis.utils.Options

Copyright © 2018 www.massapicom. 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.