Package org.apache.axis.utils

Examples of org.apache.axis.utils.Options


     */

    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(JavaUtils.getMessage("usage00","AdminClient xml-files | list"));
            return null;
        }
View Full Code Here


import java.net.URL;
import java.util.Vector;

public class TestMsg {
    public String doit(String[] args) throws Exception {
        Options opts = new Options(args);
        opts.setDefaultURL("http://localhost:8080/axis/services/MessageService");

        Service  service = new Service();
        Call     call    = (Call) service.createCall();

        call.setTargetEndpointAddress( new URL(opts.getURL()) );
        SOAPBodyElement[] input = new SOAPBodyElement[2];

        input[0] = new SOAPBodyElement(XMLUtils.StringToElement("urn:foo",
                                                                "e1", "Hello"));
        input[1] = new SOAPBodyElement(XMLUtils.StringToElement("urn:foo",
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(JavaUtils.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

     * 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

   
    // First arg passed should be the URL of the service. If none is specified, client tries localhost.
    public static void main(String[] args) throws DOMException, TrustException, Exception {

        Options opts = new Options(args);
        opts.setDefaultURL(address);

        Service service = new Service();
        Call call = (Call) service.createCall();
        call.setTargetEndpointAddress(opts.getURL());

        SOAPEnvelope env = new SOAPEnvelope();
        Document doc = env.getAsDocument();
        WSSConfig wssConfig = WSSConfig.getDefaultWSConfig();
View Full Code Here

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

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

        String maxPoolSize = opts.isValueSet( 't' );
        if ( maxPoolSize == null )
        {
            maxPoolSize = ThreadPool.DEFAULT_MAX_THREADS + "";
        }

        String maxSessions = opts.isValueSet( 'm' );
        if ( maxSessions == null )
        {
            maxSessions = DEFAULT_MAX_SESSIONS + "";
        }

        String[] nonOptionArgs = opts.getRemainingArgs();
        NotSoSimpleAxisServer server = new NotSoSimpleAxisServer( new File( nonOptionArgs[0] ), Integer.parseInt( maxPoolSize ),
                Integer.parseInt( maxSessions ) );

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

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

public class Client
{
    public static void main(String [] args)
    {
        try {
            Options options = new Options(args);
           
            String endpointURL = options.getURL();
           
            Service  service = new Service();
            Call     call    = (Call) service.createCall();

            call.setTargetEndpointAddress( new java.net.URL(endpointURL) );
View Full Code Here

import javax.xml.rpc.ParameterMode;

public class CalcClient
{
   public static void main(String [] args) throws Exception {
       Options options = new Options(args);
      
       String endpoint = "http://localhost:" + options.getPort() +
                         "/axis/Calculator.jws";
      
       args = options.getRemainingArgs();
      
       if (args == null || args.length != 3) {
           System.err.println("Usage: CalcClient <add|subtract> arg1 arg2");
           return;
       }
View Full Code Here

public class Client
{
    public static void main(String [] args)
    {
        try {
            Options options = new Options(args);
           
            String endpointURL = options.getURL();
            String textToSend;
           
            args = options.getRemainingArgs();
            if ((args == null) || (args.length < 1)) {
                textToSend = "<nothing>";
            } else {
                textToSend = args[0];
            }
View Full Code Here

                                          
public class Client
{
    public static void main(String [] args) throws Exception
    {
        Options options = new Options(args);
       
        Order order = new Order();
        order.setCustomerName("Glen Daniels");
        order.setShippingAddress("275 Grove Street, Newton, MA");
       
        String [] items = new String[] { "mp3jukebox", "1600mahBattery" };
        int [] quantities = new int [] { 1, 4 };
       
        order.setItemCodes(items);
        order.setQuantities(quantities);
       
        Service  service = new Service();
        Call     call    = (Call) service.createCall();
        QName    qn      = new QName( "urn:BeanService", "Order" );

        call.registerTypeMapping(Order.class, qn,
                      new org.apache.axis.encoding.ser.BeanSerializerFactory(Order.class, qn),       
                      new org.apache.axis.encoding.ser.BeanDeserializerFactory(Order.class, qn));       
        String result;
        try {
            call.setTargetEndpointAddress( new java.net.URL(options.getURL()) );
            call.setOperationName( new QName("OrderProcessor", "processOrder") );
            call.addParameter( "arg1", qn, ParameterMode.IN );
            call.setReturnType( org.apache.axis.encoding.XMLType.XSD_STRING );

            result = (String) call.invoke( new Object[] { order } );
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.