Package org.apache.axis2.jaxws.description.builder

Examples of org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite


   
    public void testRespectBindingDefault() throws Exception {
        JavaClassToDBCConverter converter = new JavaClassToDBCConverter(DefaultService.class);
        HashMap<String, DescriptionBuilderComposite> map = converter.produceDBC();
       
        DescriptionBuilderComposite composite = map.get(DefaultService.class.getName());
       
        URL wsdlUrl = new URL("file:./" + wsdlLocation);
        WSDL4JWrapper wrapper = new WSDL4JWrapper(wsdlUrl, false, 0);
       
        composite.setwsdlURL(wsdlUrl);
        composite.setWsdlDefinition(wrapper.getDefinition());
       
        List<ServiceDescription> sdList = DescriptionFactory.createServiceDescriptionFromDBCMap(map);
        ServiceDescription sd = sdList.get(0);
       
        EndpointDescription ed = sd.getEndpointDescription(new QName(ns, defaultServicePortName));
View Full Code Here


        assertNotNull(service);
        ServiceDelegate serviceDelegate = DescriptionTestUtils2.getServiceDelegate(service);
        assertNotNull(serviceDelegate);
        ServiceDescription serviceDesc = serviceDelegate.getServiceDescription();
        assertNotNull(serviceDesc);
        DescriptionBuilderComposite dbcInServiceDesc = DescriptionTestUtils2.getServiceDescriptionComposite(serviceDesc);
        assertNotNull(dbcInServiceDesc);
        assertEquals(Service.class, dbcInServiceDesc.getCorrespondingClass());
        // Since this is a generic Service with no overrides, there will be no WebServiceClient annotation
        WebServiceClient wsClient = dbcInServiceDesc.getWebServiceClientAnnot();
        assertNull(wsClient);
       
        // No WSDL should have been used, so no Ports should be found
        assertTrue("Wrong WSDL used", validatePort(service, null));
    }   
View Full Code Here

        assertNotNull(service);
        ServiceDelegate serviceDelegate = DescriptionTestUtils2.getServiceDelegate(service);
        assertNotNull(serviceDelegate);
        ServiceDescription serviceDesc = serviceDelegate.getServiceDescription();
        assertNotNull(serviceDesc);
        DescriptionBuilderComposite dbcInServiceDesc = DescriptionTestUtils2.getServiceDescriptionComposite(serviceDesc);
        assertNotNull(dbcInServiceDesc);
        assertEquals(Service.class, dbcInServiceDesc.getCorrespondingClass());
        // Since this is a generic Service with no overrides, there will be no WebServiceClient annotation
        WebServiceClient wsClient = dbcInServiceDesc.getWebServiceClientAnnot();
        assertNull(wsClient);

        // WSDL was specified on the create, so make sure the right one was used by checking the ports
        assertTrue("Wrong WSDL used", validatePort(service, otherWsdl_portLocalPart));
    }
View Full Code Here

    /**
     * Service.create(QName) with a composite specified but no override in the composite
     */
    public void test1ArgServiceWithComposite() {
        QName serviceQName = new QName(namespaceURI, svcLocalPart);
        DescriptionBuilderComposite composite = new DescriptionBuilderComposite();
        assertNull(ServiceDelegate.getServiceMetadata());
        // Use the proprietary SPI to create a service with additional metadata specified
        ServiceDelegate.setServiceMetadata(composite);
       
        Service service = Service.create(serviceQName);
        assertNotNull(service);
       
        // Verify that the composite has been reset so that it would not affect the next Service
        assertNull(ServiceDelegate.getServiceMetadata());
        ServiceDelegate serviceDelegate = DescriptionTestUtils2.getServiceDelegate(service);
        assertNotNull(serviceDelegate);
        ServiceDescription serviceDesc = serviceDelegate.getServiceDescription();
        assertNotNull(serviceDesc);
        DescriptionBuilderComposite dbcInServiceDesc = DescriptionTestUtils2.getServiceDescriptionComposite(serviceDesc);
        assertSame(composite, dbcInServiceDesc.getSparseComposite(serviceDelegate));
        assertEquals(Service.class, dbcInServiceDesc.getCorrespondingClass());
        // Since this is a generic Service with no overrides, there will be no WebServiceClient annotation
        WebServiceClient wsClient = dbcInServiceDesc.getWebServiceClientAnnot();
        assertNull(wsClient);
       
        // No WSDL should have been used, so no Ports should be found
        assertTrue("Wrong WSDL used", validatePort(service, null));

View Full Code Here

     * Service.create(URL, QName) with a composite specified but no override in the composite
     */
    public void test2ArgServiceWithComposite() {
        QName serviceQName = new QName(namespaceURI, svcLocalPart);

        DescriptionBuilderComposite composite = new DescriptionBuilderComposite();
        URL wsdlUrl = getWsdlURL(otherWsdl);
        // Use the proprietary SPI to create a service with additional metadata specified
        ServiceDelegate.setServiceMetadata(composite);
        Service service = Service.create(wsdlUrl, serviceQName);
        assertNotNull(service);
        // Verify that the composite has been reset so that it would not affect the next Service
        assertNull(ServiceDelegate.getServiceMetadata());
        ServiceDelegate serviceDelegate = DescriptionTestUtils2.getServiceDelegate(service);
        assertNotNull(serviceDelegate);
        ServiceDescription serviceDesc = serviceDelegate.getServiceDescription();
        assertNotNull(serviceDesc);
        DescriptionBuilderComposite dbcInServiceDesc = DescriptionTestUtils2.getServiceDescriptionComposite(serviceDesc);
        assertSame(composite, dbcInServiceDesc.getSparseComposite(serviceDelegate));
        assertEquals(Service.class, dbcInServiceDesc.getCorrespondingClass());
        // Since this is a generic Service with no overrides, there will be no WebServiceClient annotation
        WebServiceClient wsClient = dbcInServiceDesc.getWebServiceClientAnnot();
        assertNull(wsClient);
       
        // WSDL was specified on the create, so make sure the right one was used by checking the ports
        assertTrue("Wrong WSDL used", validatePort(service, otherWsdl_portLocalPart));
    }
View Full Code Here

        ServiceDelegate serviceDelegate = DescriptionTestUtils2.getServiceDelegate(service);
        assertNotNull(serviceDelegate);
        ServiceDescription serviceDesc = serviceDelegate.getServiceDescription();
        assertNotNull(serviceDesc);
        DescriptionBuilderComposite dbcInServiceDesc = DescriptionTestUtils2.getServiceDescriptionComposite(serviceDesc);
        assertEquals(ClientMetadataGeneratedService.class, dbcInServiceDesc.getCorrespondingClass());
        // There is WebServiceClient on the generated Service
        WebServiceClient wsClient = dbcInServiceDesc.getWebServiceClientAnnot();
        assertNotNull(wsClient);
        assertEquals(originalWsdl, wsClient.wsdlLocation());
        assertEquals("originalTNS", wsClient.targetNamespace());
        assertEquals("", wsClient.name());
       
View Full Code Here

        ServiceDelegate serviceDelegate = DescriptionTestUtils2.getServiceDelegate(service);
        assertNotNull(serviceDelegate);
        ServiceDescription serviceDesc = serviceDelegate.getServiceDescription();
        assertNotNull(serviceDesc);
        DescriptionBuilderComposite dbcInServiceDesc = DescriptionTestUtils2.getServiceDescriptionComposite(serviceDesc);
        assertEquals(ClientMetadataGeneratedService.class, dbcInServiceDesc.getCorrespondingClass());
        // There is WebServiceClient on the generated Service
        WebServiceClient wsClient = dbcInServiceDesc.getWebServiceClientAnnot();
        assertNotNull(wsClient);

        assertEquals(originalWsdl, wsClient.wsdlLocation());
        assertEquals("originalTNS", wsClient.targetNamespace());
        assertEquals("", wsClient.name());
View Full Code Here

   
    /**
     * Generated service constructor() with composite specified but no override in composite
     */
    public void testNoArgGeneratedServiceWithComposite() {
        DescriptionBuilderComposite composite = new DescriptionBuilderComposite();
        ServiceDelegate.setServiceMetadata(composite);

        Service service = new ClientMetadataGeneratedService();
        assertNotNull(service);
        assertNull(ServiceDelegate.getServiceMetadata());
       
        ServiceDelegate serviceDelegate = DescriptionTestUtils2.getServiceDelegate(service);
        assertNotNull(serviceDelegate);
        ServiceDescription serviceDesc = serviceDelegate.getServiceDescription();
        assertNotNull(serviceDesc);
        DescriptionBuilderComposite dbcInServiceDesc = DescriptionTestUtils2.getServiceDescriptionComposite(serviceDesc);
        assertSame(composite, dbcInServiceDesc.getSparseComposite(serviceDelegate));
        assertEquals(ClientMetadataGeneratedService.class, dbcInServiceDesc.getCorrespondingClass());
        // There is WebServiceClient on the generated Service and it wasn't overriden in the composite
        WebServiceClient wsClient = dbcInServiceDesc.getWebServiceClientAnnot();
        assertNotNull(wsClient);
        assertEquals(originalWsdl, wsClient.wsdlLocation());
        assertEquals("originalTNS", wsClient.targetNamespace());
        assertEquals("", wsClient.name());
       
View Full Code Here

    /**
     * Generated service constructor(URL, QName) with composite specified but no override in composite
     */
    public void test2ArgGeneratedServiceWithComposite() {
        DescriptionBuilderComposite composite = new DescriptionBuilderComposite();
        ServiceDelegate.setServiceMetadata(composite);

        Service service = new ClientMetadataGeneratedService(getWsdlURL(otherWsdl),
                                                             new QName(namespaceURI, svcLocalPart));
        assertNotNull(service);
        assertNull(ServiceDelegate.getServiceMetadata());
       
        ServiceDelegate serviceDelegate = DescriptionTestUtils2.getServiceDelegate(service);
        assertNotNull(serviceDelegate);
        ServiceDescription serviceDesc = serviceDelegate.getServiceDescription();
        assertNotNull(serviceDesc);
        DescriptionBuilderComposite dbcInServiceDesc = DescriptionTestUtils2.getServiceDescriptionComposite(serviceDesc);
        assertSame(composite, dbcInServiceDesc.getSparseComposite(serviceDelegate));
        assertEquals(ClientMetadataGeneratedService.class, dbcInServiceDesc.getCorrespondingClass());
        // There is WebServiceClient on the generated Service and it wasn't overriden in the composite
        WebServiceClient wsClient = dbcInServiceDesc.getWebServiceClientAnnot();
        assertNotNull(wsClient);
        assertEquals(originalWsdl, wsClient.wsdlLocation());
        assertEquals("originalTNS", wsClient.targetNamespace());
        assertEquals("", wsClient.name());

View Full Code Here

    /**
     * Service.create(QName) with a composite that specifies a wsdlLocation override
     */
    public void test1ArgServiceOverrideWsdlLocation() {
        QName serviceQName = new QName(namespaceURI, svcLocalPart);
        DescriptionBuilderComposite composite = new DescriptionBuilderComposite();
        WebServiceClientAnnot wsClientAnno =
            WebServiceClientAnnot.createWebServiceClientAnnotImpl(null, null, getWsdlLocation(overridenWsdl));
        composite.setWebServiceClientAnnot(wsClientAnno);
        // Use the proprietary SPI to create a service with additional metadata specified
        ServiceDelegate.setServiceMetadata(composite);
       
        Service service = Service.create(serviceQName);
       
        assertNotNull(service);
        // Verify that the composite has been reset so that it would not affect the next Service
        assertNull(ServiceDelegate.getServiceMetadata());
        ServiceDelegate serviceDelegate = DescriptionTestUtils2.getServiceDelegate(service);
        assertNotNull(serviceDelegate);
        ServiceDescription serviceDesc = serviceDelegate.getServiceDescription();
        assertNotNull(serviceDesc);
        DescriptionBuilderComposite dbcInServiceDesc = DescriptionTestUtils2.getServiceDescriptionComposite(serviceDesc);
        assertSame(composite, dbcInServiceDesc.getSparseComposite(serviceDelegate));
        assertEquals(Service.class, dbcInServiceDesc.getCorrespondingClass());
        // This is a generic Service with overrides, there will be WebServiceClient annotation
        WebServiceClient wsClient = dbcInServiceDesc.getWebServiceClientAnnot();
        assertNull(wsClient);
        wsClient = dbcInServiceDesc.getWebServiceClientAnnot(serviceDelegate);
        assertNotNull(wsClient);
        assertEquals(getWsdlLocation(overridenWsdl), wsClient.wsdlLocation());
        assertNull(wsClient.targetNamespace());
        assertNull(wsClient.name());
       
View Full Code Here

TOP

Related Classes of org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite

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.