Package org.apache.axis.client

Examples of org.apache.axis.client.Call


      Service  service = new Service();

      Float res = new Float(0.0F);
      for (int i=0; i<count; i++) {
          Call     call    = (Call) service.createCall();

          call.setTargetEndpointAddress( url );
          call.setOperationName( new QName("urn:xmltoday-delayed-quotes", "getQuote") );
          call.addParameter( "symbol", XMLType.XSD_STRING, ParameterMode.IN );
          call.setReturnType( XMLType.XSD_FLOAT );

          // TESTING HACK BY ROBJ
          if (symbol.equals("XXX_noaction")) {
              symbol = "XXX";
          }

          call.setUsername( user );
          call.setPassword( passwd );

          call.setProperty(AsyncCall.ASYNC_CALL_PROPERTY,
                           new Boolean(true));

          call.invoke(new Object[] {symbol});

          Object ret = null;
          try {         
            ret = call.waitForReturnValue(1000 * 20); //wait 20 seconds
          } catch (Throwable t) {
            System.out.println("Received problem response: " + t);
            throw new AxisFault("", t.toString(), null,null);
          }
         
View Full Code Here


        // create the transport
        JMSTransport transport = new JMSTransport(connectorMap, cfMap);

        // create a new Call object
        Call     call    = (Call) service.createCall();

        call.setOperationName( new QName("urn:xmltoday-delayed-quotes", "getQuote") );
        call.addParameter( "symbol", XMLType.XSD_STRING, ParameterMode.IN );
        call.setReturnType( XMLType.XSD_FLOAT );
        call.setTransport(transport);

        // set additional params on the call if desired
        //call.setUsername(username );
        //call.setPassword(password );
        //call.setProperty(JMSConstants.WAIT_FOR_RESPONSE, Boolean.FALSE);
        //call.setProperty(JMSConstants.PRIORITY, new Integer(5));
        //call.setProperty(JMSConstants.DELIVERY_MODE,
        //    new Integer(javax.jms.DeliveryMode.PERSISTENT));
        //call.setProperty(JMSConstants.TIME_TO_LIVE, new Long(20000));

        call.setProperty(JMSConstants.DESTINATION, destination);
        call.setTimeout(new Integer(10000));

        Float res = new Float(0.0F);

        // invoke a call for each of the symbols and print out
        for (int i = 0; i < args.length; i++) {
            res = (Float) call.invoke(new Object[] {args[i]});
            System.out.println(args[i] + ": " + res);
        }

        // shutdown
        listener.shutdown();
View Full Code Here

        throws SOAPException {
        if(closed){
            throw new SOAPException(Messages.getMessage("connectionClosed00"));
        }
        try {
            Call call = new Call(endpoint.toString());
            ((org.apache.axis.Message)request).setMessageContext(call.getMessageContext());
            SOAPEnvelope env = ((org.apache.axis.Message)request).getSOAPEnvelope();
            call.invoke(env);
            return call.getResponseMessage();
        } catch (java.net.MalformedURLException mue){
            throw new SOAPException(mue);
        } catch (org.apache.axis.AxisFault af){
            throw new SOAPException(af);
        } catch (java.rmi.RemoteException re){
View Full Code Here

        QName   sqn  = new QName(sURL, "ElementServiceService" );
        QName   pqn  = new QName(sURL, "ElementService" );

        //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

        // create the transport
        JMSTransport transport = new JMSTransport(null, cfProps);

        // create a new Call object
        Call     call    = (Call) service.createCall();

        call.setOperationName( new QName("urn:xmltoday-delayed-quotes", "getQuote") );
        call.addParameter( "symbol", XMLType.XSD_STRING, ParameterMode.IN );
        call.setReturnType( XMLType.XSD_FLOAT );
        call.setTransport(transport);

        // set additional params on the call if desired

        //call.setUsername(opts.getUser() );
        //call.setPassword(opts.getPassword() );

        //call.setProperty(JMSConstants.WAIT_FOR_RESPONSE, Boolean.FALSE);
        //call.setProperty(JMSConstants.PRIORITY, new Integer(5));
        //call.setProperty(JMSConstants.DELIVERY_MODE,
        //    new Integer(javax.jms.DeliveryMode.PERSISTENT));
        //call.setProperty(JMSConstants.TIME_TO_LIVE, new Long(20000));

        call.setProperty(JMSConstants.DESTINATION, "SampleQ1");
        call.setTimeout(new Integer(10000));

        Float res = new Float(0.0F);

        // invoke a call for each of the symbols and print out
        for (int i = 0; i < symbols.length; i++) {
            res = (Float) call.invoke(new Object[] {symbols[i]});
            System.out.println(symbols[i] + ": " + res);
        }

        // shutdown
        listener.shutdown();
View Full Code Here

     * is the length of the string (doubled if the doubled arg is true).
     */
    public boolean runTest(SOAPHeaderElement header,
                           boolean doubled) throws Exception
    {
        Call call = new Call(new Service());
        call.setTransport(localTransport);
       
        call.addHeader(header);
       
        String str = "a";
        int maxChars = new Random().nextInt(50);
        for (int i = 0; i < maxChars; i++) {
            str += "a";
        }

        Integer i = (Integer)call.invoke("countChars", new Object [] { str });
       
        int desiredResult = str.length();
        if (doubled) desiredResult = desiredResult * 2;
       
        return (i.intValue() == desiredResult);
View Full Code Here

     * Get an initialized Call, ready to invoke us over the local transport.
     *
     * @return an initialized Call object.
     */
    public Call getCall() {
        Call call = new Call(new Service());
        call.setTransport(transport);
        return call;
    }
View Full Code Here

        IF1 bean = null;

        if (id == null)
            throw new Exception("invalid id");

            Call call = getCall();
            call.setTargetEndpointAddress(m_url);
            call.setOperationName(new QName(m_service, "getBeanById"));
            call.addParameter("id", org.apache.axis.Constants.XSD_STRING, ParameterMode.IN);
            call.setReturnType(m_beanQName);
            bean = (IF1) call.invoke(new Object[] { id });

        return bean;
    }
View Full Code Here

    public IF1[] getAllBeans(String[] filter)
        throws Exception
    {
        IF1[] beans = null;

            Call call = getCall();
            call.setTargetEndpointAddress(m_url);
            call.setOperationName(new QName(m_service, "getAllBeans"));
            call.setReturnType(m_beanArrayQName);
            if (filter == null)
                beans = (IF1[]) call.invoke(new Object[0]);
            else
            {
                call.addParameter("filter", m_stringArrayQName, ParameterMode.IN);
                beans = (IF1[]) call.invoke(new Object[] { filter });
            }

        return beans;
    }
View Full Code Here

    public String[] getAllCategories()
        throws Exception
    {
        String[] categories = null;

            Call call = getCall();
            call.setTargetEndpointAddress(m_url);
            call.setOperationName(new QName(m_service, "getAllCategories"));
            call.setReturnType(m_stringArrayQName);
            categories = (String[]) call.invoke(new Object[0]);

        return categories;
    }
View Full Code Here

TOP

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

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.