Package javax.xml.rpc

Examples of javax.xml.rpc.Call


    Method method = invocation.getMethod();
    QName portQName = this.portQName;

    // Create JAX-RPC call object, using the method name as operation name.
    // Synchronized because of non-thread-safe Axis implementation!
    Call call = null;
    synchronized (service) {
      call = service.createCall(portQName, method.getName());
    }

    // Apply properties to JAX-RPC stub.
    prepareJaxRpcCall(call);

    // Allow for custom post-processing in subclasses.
    postProcessJaxRpcCall(call, invocation);

    // Perform actual invocation.
    return call.invoke(invocation.getArguments());
  }
View Full Code Here


      try
      {
         ServiceFactory serviceFactory = ServiceFactory.newInstance();

         Service service = serviceFactory.createService(new URL(wsdlLocation), new QName(NAMESPACE, "ValidURLService"));
         Call call = (Call)service.createCall(new QName(NAMESPACE, "ValidURLPort"), "sayHello");
         assertEquals("http://" + webServiceHost + ":8080/jaxrpc-addressrewrite/ValidURL", call.getTargetEndpointAddress());

         service = serviceFactory.createService(new URL(wsdlLocation), new QName(NAMESPACE, "InvalidURLService"));
         call = (Call)service.createCall(new QName(NAMESPACE, "InvalidURLPort"), "sayHello");
         assertEquals("http://" + webServiceHost + ":8080/jaxrpc-addressrewrite/InvalidURL", call.getTargetEndpointAddress());

         service = serviceFactory.createService(new URL(wsdlLocation), new QName(NAMESPACE, "ValidSecureURLService"));
         call = (Call)service.createCall(new QName(NAMESPACE, "ValidSecureURLPort"), "sayHello");
         assertEquals("https://" + webServiceHost + ":8443/jaxrpc-addressrewrite/ValidSecureURL", call.getTargetEndpointAddress());

         service = serviceFactory.createService(new URL(wsdlLocation), new QName(NAMESPACE, "InvalidSecureURLService"));
         call = (Call)service.createCall(new QName(NAMESPACE, "InvalidSecureURLPort"), "sayHello");
         assertEquals("https://" + webServiceHost + ":8443/jaxrpc-addressrewrite/InvalidSecureURL", call.getTargetEndpointAddress());
      }
      finally
      {
         undeploy("jaxrpc-addressrewrite.war");
      }
View Full Code Here

      try
      {
         ServiceFactory serviceFactory = ServiceFactory.newInstance();

         Service service = serviceFactory.createService(new URL(wsdlLocationSec), new QName(NAMESPACE, "ValidURLService"));
         Call call = (Call)service.createCall(new QName(NAMESPACE, "ValidURLPort"), "sayHello");
         assertEquals("https://" + webServiceHost + ":8443/jaxrpc-addressrewrite-sec/ValidURL", call.getTargetEndpointAddress());

         service = serviceFactory.createService(new URL(wsdlLocationSec), new QName(NAMESPACE, "InvalidURLService"));
         call = (Call)service.createCall(new QName(NAMESPACE, "InvalidURLPort"), "sayHello");
         assertEquals("https://" + webServiceHost + ":8443/jaxrpc-addressrewrite-sec/InvalidURL", call.getTargetEndpointAddress());

         service = serviceFactory.createService(new URL(wsdlLocationSec), new QName(NAMESPACE, "ValidSecureURLService"));
         call = (Call)service.createCall(new QName(NAMESPACE, "ValidSecureURLPort"), "sayHello");
         assertEquals("https://" + webServiceHost + ":8443/jaxrpc-addressrewrite-sec/ValidSecureURL", call.getTargetEndpointAddress());

         service = serviceFactory.createService(new URL(wsdlLocationSec), new QName(NAMESPACE, "InvalidSecureURLService"));
         call = (Call)service.createCall(new QName(NAMESPACE, "InvalidSecureURLPort"), "sayHello");
         assertEquals("https://" + webServiceHost + ":8443/jaxrpc-addressrewrite-sec/InvalidSecureURL", call.getTargetEndpointAddress());
      }
      finally
      {
         undeploy("jaxrpc-addressrewrite-sec.war");
      }
View Full Code Here

      try
      {
         ServiceFactory serviceFactory = ServiceFactory.newInstance();

         Service service = serviceFactory.createService(new URL(wsdlLocation), new QName(NAMESPACE, "ValidURLService"));
         Call call = (Call)service.createCall(new QName(NAMESPACE, "ValidURLPort"), "sayHello");
         assertEquals("http://somehost:80/somepath", call.getTargetEndpointAddress());

         service = serviceFactory.createService(new URL(wsdlLocation), new QName(NAMESPACE, "InvalidURLService"));
         call = (Call)service.createCall(new QName(NAMESPACE, "InvalidURLPort"), "sayHello");
         assertEquals("http://" + webServiceHost + ":8080/jaxrpc-addressrewrite/InvalidURL", call.getTargetEndpointAddress());

         service = serviceFactory.createService(new URL(wsdlLocation), new QName(NAMESPACE, "ValidSecureURLService"));
         call = (Call)service.createCall(new QName(NAMESPACE, "ValidSecureURLPort"), "sayHello");
         assertEquals("https://somehost:443/some-secure-path", call.getTargetEndpointAddress());

         service = serviceFactory.createService(new URL(wsdlLocation), new QName(NAMESPACE, "InvalidSecureURLService"));
         call = (Call)service.createCall(new QName(NAMESPACE, "InvalidSecureURLPort"), "sayHello");
         assertEquals("https://" + webServiceHost + ":8443/jaxrpc-addressrewrite/InvalidSecureURL", call.getTargetEndpointAddress());
      }
      finally
      {
         undeploy("jaxrpc-addressrewrite.war");
      }
View Full Code Here

  protected Object performJaxRpcCall(MethodInvocation invocation, Service service) throws Throwable {
    QName portQName = getPortQName();

    // Create JAX-RPC call object, using the method name as operation name.
    // Synchronized because of non-thread-safe Axis implementation!
    Call call = null;
    synchronized (service) {
      call = service.createCall(portQName, invocation.getMethod().getName());
    }

    // Apply properties to JAX-RPC stub.
    prepareJaxRpcCall(call);

    // Allow for custom post-processing in subclasses.
    postProcessJaxRpcCall(call, invocation);

    // Perform actual invocation.
    try {
      return call.invoke(invocation.getArguments());
    }
    catch (RemoteException ex) {
      boolean isConnectFailure = isConnectFailure(ex);
      if (isConnectFailure && this.refreshServiceAfterConnectFailure) {
        reset();
View Full Code Here

    Method method = invocation.getMethod();
    QName portQName = this.portQName;

    // Create JAX-RPC call object, using the method name as operation name.
    // Synchronized because of non-thread-safe Axis implementation!
    Call call = null;
    synchronized (service) {
      call = service.createCall(portQName, method.getName());
    }

    // Apply properties to JAX-RPC stub.
    prepareJaxRpcCall(call);

    // Allow for custom post-processing in subclasses.
    postProcessJaxRpcCall(call, invocation);

    // Perform actual invocation.
    return call.invoke(invocation.getArguments());
  }
View Full Code Here

    Method method = invocation.getMethod();
    QName portQName = this.portQName;

    // Create JAX-RPC call object, using the method name as operation name.
    // Synchronized because of non-thread-safe Axis implementation!
    Call call = null;
    synchronized (service) {
      call = service.createCall(portQName, method.getName());
    }

    // Apply properties to JAX-RPC stub.
    prepareJaxRpcCall(call);

    // Allow for custom post-processing in subclasses.
    postProcessJaxRpcCall(call, invocation);

    // Perform actual invocation.
    return call.invoke(invocation.getArguments());
  }
View Full Code Here

    private JaxRpcMarshaler marshaler = new JaxRpcMarshaler();


    protected void process(MessageExchange messageExchange, NormalizedMessage inMessage) throws Exception {
        Call call = marshaler.createCall(inMessage);
        Object[] params = marshaler.getCallParams(inMessage);

        call.invokeOneWay(params);
        done(messageExchange);
    }
View Full Code Here

        /* Now use those QNames as pointers into the WSDL doc */
        /******************************************************/
        Service service = ServiceFactory.newInstance().createService(
                new URL("file:samples/stock/GetQuote.wsdl"), servQN);
        Call call = service.createCall(portQN, "getQuote");

        /* Strange - but allows the user to change just certain portions of */
        /* the URL we're gonna use to invoke the service.  Useful when you  */
        /* want to run it thru tcpmon (ie. put  -p81 on the cmd line).      */
        /********************************************************************/
        opts.setDefaultURL(call.getTargetEndpointAddress());
        call.setTargetEndpointAddress(opts.getURL());

        /* Define some service specific properties */
        /*******************************************/
        call.setProperty(Call.USERNAME_PROPERTY, opts.getUser());
        call.setProperty(Call.PASSWORD_PROPERTY, opts.getPassword());

        /* Get symbol and invoke the service */
        /*************************************/
        Object result = call.invoke(new Object[] {symbol = args[0]});

        return ((Float) result).floatValue();
    } // getQuote1
View Full Code Here

        }

        /* Create default/empty Service and Call object */
        /************************************************/
        Service service = ServiceFactory.newInstance().createService(null);
        Call call = service.createCall();

        /* Strange - but allows the user to change just certain portions of */
        /* the URL we're gonna use to invoke the service.  Useful when you  */
        /* want to run it thru tcpmon (ie. put  -p81 on the cmd line).      */
        /********************************************************************/
        opts.setDefaultURL("http://localhost:8080/axis/servlet/AxisServlet");

        /* Set all of the stuff that would normally come from WSDL */
        /***********************************************************/
        call.setTargetEndpointAddress(opts.getURL());
        call.setProperty(Call.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
        call.setProperty(Call.SOAPACTION_URI_PROPERTY, "getQuote");
        call.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY,
                "http://schemas.xmlsoap.org/soap/encoding/");
        call.setOperationName(new QName("urn:xmltoday-delayed-quotes", "getQuote"));
        call.addParameter("symbol", XMLType.XSD_STRING, ParameterMode.IN);
        call.setReturnType(XMLType.XSD_FLOAT);

        /* Define some service specific properties */
        /*******************************************/
        call.setProperty(Call.USERNAME_PROPERTY, opts.getUser());
        call.setProperty(Call.PASSWORD_PROPERTY, opts.getPassword());

        /* Get symbol and invoke the service */
        /*************************************/
        Object result = call.invoke(new Object[] {symbol = args[0]});

        return ((Float) result).floatValue();
    } // getQuote2
View Full Code Here

TOP

Related Classes of javax.xml.rpc.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.