Package org.apache.axis.client

Examples of org.apache.axis.client.ServiceClient


                textToSend = "<nothing>";
            } else {
                textToSend = args[0];
            }
           
            ServiceClient client = new ServiceClient(endpointURL);
           
            String ret = (String)client.invoke("MyService", "serviceMethod",
                                               new Object [] { textToSend });
           
            System.out.println("You typed : " + ret);
        } catch (Exception e) {
            System.err.println(e.toString());
View Full Code Here


{
   public static void main(String [] args) {
       try {
           String endpoint = "http://nagoya.apache.org:5049/axis/servlet/AxisServlet";
    
           ServiceClient client = new ServiceClient(endpoint);
           String ret = (String)client.invoke("http://soapinterop.org/",
                                              "echoString",
                                              new Object [] { "Hello!" });
          
           System.out.println("Sent 'Hello!', got '" + ret + "'");
       } catch (Exception e) {
View Full Code Here

       }
      
       Integer i1 = new Integer(args[1]);
       Integer i2 = new Integer(args[2]);

       ServiceClient client = new ServiceClient(endpoint);
       Integer ret = (Integer)client.invoke("",
                                          method,
                                          new Object [] { i1, i2 });
      
       System.out.println("Got result : " + ret);
   }
View Full Code Here

      }

      String namespace = "urn:xmltoday-delayed-quotes";
      symbol = args[0] ;

      ServiceClient call = new ServiceClient(opts.getURL());
      call.setTransport(new TCPTransport());
      ServiceDescription sd = new ServiceDescription("stockQuotes", true);
      sd.addInputParam("symbol", SOAPTypeMappingRegistry.XSD_STRING);
      sd.setOutputType(SOAPTypeMappingRegistry.XSD_FLOAT);
      call.setServiceDescription(sd);
     
      // TESTING HACK BY ROBJ
      if (symbol.equals("XXX_noaction")) {
          symbol = "XXX";
          call.set(HTTPConstants.MC_HTTP_SOAPACTION, "");
      }

      call.set( Transport.USER, opts.getUser() );
      call.set( Transport.PASSWORD, opts.getPassword() );

      // 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");
      }

      Float res = new Float(0.0F);
      for (int i=0; i<count; i++) {
          Object ret = call.invoke(
          namespace, "getQuote", new Object[] {symbol} );
          if (ret instanceof String) {
              System.out.println("Received problem response from server: "+ret);
              throw new AxisFault("", (String)ret, null, null);
          }
View Full Code Here

      }

      String namespace = "urn:xmltoday-delayed-quotes";
      symbol = args[0] ;

      ServiceClient call = new ServiceClient(opts.getURL());
      ServiceDescription sd = new ServiceDescription("stockQuotes", true);
      sd.addInputParam("symbol", SOAPTypeMappingRegistry.XSD_STRING);
      sd.setOutputType(SOAPTypeMappingRegistry.XSD_FLOAT);
      call.setServiceDescription(sd);
     
      // TESTING HACK BY ROBJ
      if (symbol.equals("XXX_noaction")) {
          symbol = "XXX";
          call.set(HTTPConstants.MC_HTTP_SOAPACTION, "");
      }

      call.set( Transport.USER, opts.getUser() );
      call.set( Transport.PASSWORD, opts.getPassword() );

      // 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");
      }

      Float res = new Float(0.0F);
      for (int i=0; i<count; i++) {
          Object ret = call.invoke(
          namespace, "getQuote", new Object[] {symbol} );
          if (ret instanceof String) {
              System.out.println("Received problem response from server: "+ret);
              throw new AxisFault("", (String)ret, null, null);
          }
View Full Code Here

     * Set up the call object.
     */
    public void setURL(String url)
        throws AxisFault
    {
        call = new ServiceClient(url);
        map = call.getMessageContext().getTypeMappingRegistry();
    }
View Full Code Here

        System.err.println( "Usage: GetInfo <symbol> <datatype>" );
        System.exit(1);
      }

      String  symbol = args[0] ;
      ServiceClient call = new ServiceClient
            (new HTTPTransport(opts.getURL(), "urn:cominfo"));

      call.set( Transport.USER, opts.getUser() );
      call.set( Transport.PASSWORD, opts.getPassword() );
      String res = (String) call.invoke(
        "urn:cominfo", "getInfo",
        new Object[] { args[0], args[1] } );
     
      System.out.println( symbol + ": " + res );
    }
View Full Code Here

     *   -h localhost -p 8080 -s /soap/servlet/rpcrouter
     */
    public static void main(String args[]) throws Exception {
        // set up the call object
        Options opts = new Options(args);
        call = new ServiceClient(opts.getURL());
        call.set(HTTPTransport.ACTION, "http://www.soapinterop.org/Bid");

        // register the PurchaseOrder class
        QName poqn = new QName("http://www.soapinterop.org/Bid",
                               "PurchaseOrder");
View Full Code Here

       
        // what is our target URL?
        String dest = (String)self.getOption("URL");
       
        // use the server's client engine in case anything has been deployed to it
        ServiceClient client = new ServiceClient(msgContext.getAxisEngine().getClientEngine());
       
        // add TCP for proxy testing
        client.addTransportPackage("samples.transport");
        client.setTransportForProtocol("tcp", TCPTransport.class);
       
        // NOW set the client's URL (since now the tcp handler exists)
        client.setURL(dest);
       
        client.setRequestMessage(msgContext.getRequestMessage());
       
        client.invoke();
       
        msgContext.setResponseMessage(client.getMessageContext().getResponseMessage());
       
        // return null so MsgProvider will not muck with our response
        return null;
    }
View Full Code Here

import java.math.BigDecimal ;

public class v3 implements vInterface {
  public void register(String registryURL, Service s) throws Exception {
    try {
      ServiceClient call = new ServiceClient
            (new HTTPTransport(registryURL, "http://www.soapinterop.org/Register"));
      RPCElement body = new RPCElement( "http://www.soapinterop.org/Registry",
                                        "Register",
                                        new RPCParam[] {
                                          new RPCParam("ServiceName",
                                                       s.getServiceName()),
                                          new RPCParam("SerivceURL",
                                                       s.getServiceUrl()),
                                          new RPCParam("ServiceType",
                                                       s.getServiceType()),
                                          new RPCParam("ServiceWSDL",
                                                       s.getServiceWsdl()) } );
      call.invoke( body );
    }
    catch( Exception e ) {
      e.printStackTrace();
      throw e ;
    }
View Full Code Here

TOP

Related Classes of org.apache.axis.client.ServiceClient

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.