Package javax.xml.rpc

Examples of javax.xml.rpc.ServiceFactory


   public void testHostAddress() throws Exception
   {
      InetAddress inetAddr = InetAddress.getByName(getServerHost());
      URL wsdlURL = new URL("http://" + inetAddr.getHostAddress() + ":8080/jaxws-jbws1178/testpattern?wsdl");

      ServiceFactory factory = ServiceFactory.newInstance();
      QName serviceName = new QName("http://org.jboss.ws/jbws1178", "TestEndpointService");
      QName portName = new QName("http://org.jboss.ws/jbws1178", "TestEndpointPort");
      Service service = factory.createService(wsdlURL, serviceName);
      CallImpl call = (CallImpl)service.createCall(portName);
      URL epURL = new URL(call.getEndpointMetaData().getEndpointAddress());

      assertEquals(wsdlURL.getHost(), epURL.getHost());
   }
View Full Code Here


   public void testHostName() throws Exception
   {
      InetAddress inetAddr = InetAddress.getByName(getServerHost());
      URL wsdlURL = new URL("http://" + inetAddr.getHostName() + ":8080/jaxws-jbws1178/testpattern?wsdl");

      ServiceFactory factory = ServiceFactory.newInstance();
      QName serviceName = new QName("http://org.jboss.ws/jbws1178", "TestEndpointService");
      QName portName = new QName("http://org.jboss.ws/jbws1178", "TestEndpointPort");
      Service service = factory.createService(wsdlURL, serviceName);
      CallImpl call = (CallImpl)service.createCall(portName);
      URL epURL = new URL(call.getEndpointMetaData().getEndpointAddress());

      assertEquals(wsdlURL.getHost(), epURL.getHost());
   }
View Full Code Here

   {
      setModifySOAPAddress(true);
      deploy("jaxrpc-addressrewrite.war");
      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
      {
View Full Code Here

   public void testSecureRewrite() throws Exception
   {
      deploy("jaxrpc-addressrewrite-sec.war");
      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
      {
View Full Code Here

   {
      setModifySOAPAddress(false);
      deploy("jaxrpc-addressrewrite.war");
      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
      {
View Full Code Here

   * @see #setServiceName
   * @see #setWsdlDocumentUrl
   * @see #postProcessJaxRpcService
   */
  public Service createJaxRpcService() throws ServiceException {
    ServiceFactory serviceFactory = getServiceFactory();
    if (serviceFactory == null) {
      serviceFactory = createServiceFactory();
    }

    // Create service based on this factory's settings.
View Full Code Here

    * Tests creating the service via JAX-RPC ServiceFactory.
    */
   public void testServiceCreation(  )
   throws Exception
   {
      final ServiceFactory service_factory = ServiceFactory.newInstance(  );
      final Service        service = service_factory.createService( ExampleConstants.SERVICE_QNAME );
      assertTrue( service != null );
      assertEquals( ExampleConstants.SERVICE_QNAME,
                    service.getServiceName(  ) );

      return;
View Full Code Here

    logger.info("Address used: " + address);
    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);
      }
View Full Code Here

            // do operation in a doPrivivileged block.  JAXRPC RI should
            // probably have the doPrivileged as well.

            final URL wsdlFileURL = privilegedGetServiceRefWsdl(serviceRef);
            final QName serviceName = serviceRef.getServiceName();
            final ServiceFactory serviceFactory = ServiceFactory.newInstance();

            service = (javax.xml.rpc.Service)
                java.security.AccessController.doPrivileged
                (new java.security.PrivilegedExceptionAction() {
                        public java.lang.Object run() throws Exception {
                            return serviceFactory.createService
                                (wsdlFileURL, serviceName);
                        }
                    });

        } catch(PrivilegedActionException pae) {
View Full Code Here

            // do operation in a doPrivivileged block.  JAXRPC RI should
            // probably have the doPrivileged as well.

            final URL wsdlFileURL = privilegedGetServiceRefWsdl(serviceRef);
            final QName serviceName = serviceRef.getServiceName();
            final ServiceFactory serviceFactory = ServiceFactory.newInstance();

            service = (javax.xml.rpc.Service)
                java.security.AccessController.doPrivileged
                (new java.security.PrivilegedExceptionAction() {
                        public java.lang.Object run() throws Exception {
                            return serviceFactory.createService
                                (wsdlFileURL, serviceName);
                        }
                    });

        } catch(PrivilegedActionException pae) {
View Full Code Here

TOP

Related Classes of javax.xml.rpc.ServiceFactory

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.