Package javax.xml.rpc

Examples of javax.xml.rpc.Service


            String namespaceURI = "http://acme.org/magicGball";
            QName serviceQName = new QName(namespaceURI, "MagicGBallService");
            QName portQName = new QName(namespaceURI, "MagicGBallPort");

            ServiceFactory serviceFactory = ServiceFactory.newInstance();
            Service service = serviceFactory.createService(wsdlURL, serviceQName);
            MagicGBallEndpoint mGball = (MagicGBallEndpoint) service.getPort(portQName, MagicGBallEndpoint.class);

            for (int i = 0; i < args.length; i++) {
                String question = args[i];
                String answer = mGball.ask(question);
                System.out.println(answer);
View Full Code Here


    logger.info("If this address is not correct, use 'setAddress()' to change it.");
    try
      {
          // creation of a Call object for the communication
          ServiceFactory serviceFactory = ServiceFactory.newInstance();
          Service service = serviceFactory.createService(new QName(webServicesName));
          call = (Call) service.createCall();
     
          // address of the service
          call.setTargetEndpointAddress(address);
      }
      catch (Exception e)
View Full Code Here

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

        String  symbol  = args[0];
        Service service = ServiceFactory.newInstance().createService(null);
        Call    call    = service.createCall();

        call.setTargetEndpointAddress(opts.getURL());
        call.setOperationName(new QName("urn:cominfo", "getInfo"));
        call.addParameter("symbol", XMLType.XSD_STRING, ParameterMode.IN);
        call.addParameter("info", XMLType.XSD_STRING, ParameterMode.IN);
View Full Code Here

                "GetQuoteService");
        QName portQN = new QName("urn:xmltoday-delayed-quotes", "GetQuote");

        /* 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).      */
        /********************************************************************/
 
View Full Code Here

            System.exit(1);
        }

        /* 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).      */
        /********************************************************************/
 
View Full Code Here

                "GetQuoteService");
        QName portQN = new QName("urn:xmltoday-delayed-quotes", "GetQuote");

        /* 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).      */
        /********************************************************************/
 
View Full Code Here

        if (referenceClass != null && Service.class.isAssignableFrom(referenceClass)) {
            serviceClass = referenceClass.asSubclass(Service.class);
        }

        try {
            Service instance;
            if (Service.class.equals(serviceClass)) {
                instance = ServiceFactory.newInstance().createService(getWsdlURL(), serviceQName);
            } else {
                try {
                    instance = serviceClass.getConstructor(URL.class, QName.class).newInstance(getWsdlURL(), serviceQName);
                } catch (Throwable e) {
                    throw (NamingException) new NamingException("Could not instantiate jax-ws service class " + serviceClass.getName()).initCause(e);
                }
            }

            if (referenceClass != null && !Service.class.isAssignableFrom(referenceClass)) {
                // do port lookup
                return instance.getPort(referenceClass);
            } else {
                // return service
                return instance;
            }
        } catch (ServiceException e) {
View Full Code Here

        System.out.println("Endpoint address = " + args[0]);

        try {
            ServiceFactory factory = ServiceFactory.newInstance();
            Service service = factory.createService(new QName(qnameService));
   
            QName port = new QName(qnamePort);
   
            Call call = service.createCall(port);

            call.setTargetEndpointAddress(args[0]);
            call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
            call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");
            call.setProperty(ENCODING_STYLE_PROPERTY, URI_ENCODING);
View Full Code Here

            System.out.println("UrlString = " + UrlString);
            URL helloWsdlUrl = new URL(UrlString);
           
            ServiceFactory serviceFactory = ServiceFactory.newInstance();
           
            Service helloService = serviceFactory.createService(helloWsdlUrl,
                    new QName(nameSpaceUri, serviceName));
           
            dynamicproxy.HelloIF
                    myProxy = (dynamicproxy.HelloIF) helloService.getPort(new QName(nameSpaceUri,
                    portName),
                    dynamicproxy.HelloIF.class);

            System.out.println(myProxy.sayHello("Buzz"));
View Full Code Here

   }

   public void testBasicSecuredServiceAccess() throws Exception
   {
      InitialContext iniCtx = getClientContext();
      Service service = (Service)iniCtx.lookup("java:comp/env/service/BasicSecured");
      Organization endpoint = (Organization)service.getPort(new QName(nsURI, "BasicSecuredPort"), Organization.class);

      try
      {
         endpoint.getContactInfo("mafia");
         fail("Security exception expected");
View Full Code Here

TOP

Related Classes of javax.xml.rpc.Service

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.