Package javax.xml.ws.handler

Examples of javax.xml.ws.handler.PortInfo


            EndpointConfigMetaData ecmd = epMetaData.getEndpointConfigMetaData();
            handlerResolver.initHandlerChain(ecmd, HandlerType.PRE, true);
            handlerResolver.initHandlerChain(ecmd, HandlerType.ENDPOINT, true);
            handlerResolver.initHandlerChain(ecmd, HandlerType.POST, true);
           
            PortInfo portInfo = epMetaData.getPortInfo();
            List<Handler> preChain = handlerResolver.getHandlerChain(portInfo, HandlerType.PRE);
            List<Handler> epChain = handlerResolver.getHandlerChain(portInfo, HandlerType.ENDPOINT);
            List<Handler> postChain = handlerResolver.getHandlerChain(portInfo, HandlerType.POST);
           
            binding.setHandlerChain(preChain, HandlerType.PRE);
View Full Code Here


    */
   private void initBindingHandlerChain(boolean clearExistingHandlers)
   {
      BindingExt binding = (BindingExt)getBindingProvider().getBinding();

      PortInfo portInfo = epMetaData.getPortInfo();

      if (handlerResolver != null)
      {

         boolean jbossHandlerResolver = handlerResolver instanceof HandlerResolverImpl;
View Full Code Here

        service.setHandlerResolver(resolver);
       
        CalculatorPortType cal = (CalculatorPortType)service.getPort(PORT_1, CalculatorPortType.class);
        assertNotNull(cal);

        PortInfo info = resolver.getPortInfo();
        assertNotNull(info);
        assertEquals(SERVICE_1, info.getServiceName());
        assertEquals(PORT_1, info.getPortName());
        assertEquals(SOAPBinding.SOAP12HTTP_BINDING, info.getBindingID());
    }
View Full Code Here

        QName portQName = new QName(namespaceURI, portLocalPart);

        Service service = Service.create(serviceQName);
        HandlerResolver resolver = service.getHandlerResolver();
        assertNotNull(resolver);
        PortInfo pi = new DummyPortInfo();
        List<Handler> list = resolver.getHandlerChain(pi);
        assertEquals(0, list.size());
       
        ClientMetadataHandlerChainTestSEI port = service.getPort(portQName, ClientMetadataHandlerChainTestSEI.class);
        // Verify that ports created under the service have no handlers from the sparse composite
View Full Code Here

        ClientMetadataHandlerChainTestSEI port = service.getPort(portQName, ClientMetadataHandlerChainTestSEI.class);

        // Verify the HandlerResolver on the service knows about the handlers in the sparse composite
        HandlerResolver resolver = service.getHandlerResolver();
        assertNotNull(resolver);
        PortInfo pi = new DummyPortInfo();
        List<Handler> list = resolver.getHandlerChain(pi);
        assertEquals(2, list.size());
       
        // Verify that the port created with the sparse metadata has those handlers
        BindingProvider bindingProvider = (BindingProvider) port;
        Binding binding = (Binding) bindingProvider.getBinding();
        List<Handler> portHandlers = binding.getHandlerChain();
        assertEquals(2, portHandlers.size());
        assertTrue(containSameHandlers(portHandlers, list));
       
        // Verify that a creating another instance of the same port also gets those handlers
        ClientMetadataHandlerChainTestSEI port2 = service.getPort(portQName, ClientMetadataHandlerChainTestSEI.class);
        BindingProvider bindingProvider2 = (BindingProvider) port2;
        Binding binding2 = (Binding) bindingProvider2.getBinding();
        List<Handler> portHandlers2 = binding2.getHandlerChain();
        assertNotSame(port, port2);
        assertEquals(2, portHandlers2.size());
        assertTrue(containSameHandlers(portHandlers2, list));
       
        // Verify that createing a different port doesn't get the handlers
        QName portQName3 = new QName(namespaceURI, portLocalPart + "3");
        ClientMetadataHandlerChainTestSEI port3 = service.getPort(portQName3, ClientMetadataHandlerChainTestSEI.class);
        BindingProvider bindingProvider3 = (BindingProvider) port3;
        Binding binding3 = (Binding) bindingProvider3.getBinding();
        List<Handler> portHandlers3 = binding3.getHandlerChain();
        assertEquals(0, portHandlers3.size());
       
        // Verify setting the metadata on a different port (a different QName) will get handlers.
        QName portQName4 = new QName(namespaceURI, portLocalPart + "4");
        ServiceDelegate.setPortMetadata(sparseComposite);
        ClientMetadataHandlerChainTestSEI port4 = service.getPort(portQName4, ClientMetadataHandlerChainTestSEI.class);
        BindingProvider bindingProvider4 = (BindingProvider) port4;
        Binding binding4 = (Binding) bindingProvider4.getBinding();
        List<Handler> portHandlers4 = binding4.getHandlerChain();
        assertEquals(2, portHandlers4.size());
       
        // Verify the service handler resolver knows about boths sets of handlers
        // attached to the two different port QNames and none are attached for the third port
        List<Handler> listForPort = resolver.getHandlerChain(pi);
        assertEquals(2, listForPort.size());

        PortInfo pi4 = new DummyPortInfo(portQName4);
        List<Handler> listForPort4 = resolver.getHandlerChain(pi4);
        assertEquals(2, listForPort4.size());
       
        PortInfo pi3 = new DummyPortInfo(portQName3);
        List<Handler> listForPort3 = resolver.getHandlerChain(pi3);
        assertEquals(0, listForPort3.size());
    }
View Full Code Here

            // Need to cache the ServiceDescriptions so that they are shared
            // across the two instances of the same Service.
            ClientMetadataTest.installCachingFactory();
           
            QName serviceQName = new QName(namespaceURI, svcLocalPart);
            PortInfo pi = new DummyPortInfo();

            // Create a Service specifying a sparse composite and verify the
            // ports under that service get the correct handlers associated.
            DescriptionBuilderComposite sparseComposite = new DescriptionBuilderComposite();
            HandlerChainsType handlerChainsType = getHandlerChainsType();
View Full Code Here

            // Need to cache the ServiceDescriptions so that they are shared
            // across the two instances of the same Service.
            ClientMetadataTest.installCachingFactory();
           
            QName serviceQName = new QName(namespaceURI, svcLocalPart);
            PortInfo pi = new DummyPortInfo();

            // Create two instances of the same Service
            Service service1 = Service.create(serviceQName);
            Service service2 = Service.create(serviceQName);
View Full Code Here

       
        ServiceDescription serviceDesc =
            DescriptionFactory.createServiceDescription(null, serviceQName, HandlerResolverTestService.class, sparseComposite, serviceDelegateKey);
        HandlerResolver resolver = new HandlerResolverImpl(serviceDesc);
        assertNotNull(resolver);
        PortInfo pi = new DummyPortInfo();
        List<Handler> list = resolver.getHandlerChain(pi);
        assertEquals(0, list.size());
    }
View Full Code Here

            DescriptionFactory.createServiceDescription(null, serviceQName, HandlerResolverTestService.class, sparseComposite, serviceDelegateKey);
        EndpointDescription endpointDesc =
            DescriptionFactory.updateEndpoint(serviceDesc, HandlerResolverTestSEI.class, portQName, DescriptionFactory.UpdateType.GET_PORT);
        HandlerResolver resolver = new HandlerResolverImpl(serviceDesc, serviceDelegateKey);
        assertNotNull(resolver);
        PortInfo pi = new DummyPortInfo();
        List<Handler> list = resolver.getHandlerChain(pi);
        assertEquals(0, list.size());
    }
View Full Code Here

            DescriptionFactory.createServiceDescription(null, serviceQName, HandlerResolverTestService.class, sparseComposite, serviceDelegateKey);
        EndpointDescription endpointDesc =
            DescriptionFactory.updateEndpoint(serviceDesc, HandlerResolverTestSEI.class, portQName, DescriptionFactory.UpdateType.GET_PORT);
        HandlerResolver resolver = new HandlerResolverImpl(serviceDesc, serviceDelegateKey);
        assertNotNull(resolver);
        PortInfo pi = new DummyPortInfo();
        List<Handler> list = resolver.getHandlerChain(pi);
        assertEquals(2, list.size());
       
    }
View Full Code Here

TOP

Related Classes of javax.xml.ws.handler.PortInfo

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.