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

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


   
    /**
     * Test override WSDL file that is full specified
     */
    public void testInvalidWsdlLocationOverrideWithProtocol() {
        DescriptionBuilderComposite composite = new DescriptionBuilderComposite();
        String wsdlLocation = getWsdlLocation("InvalidFileName.wsdl");
        // This check is necessary because Unix/Linux file paths begin
        // with a '/'. When adding the prefix 'jar:file:/' we may end
        // up with '//' after the 'file:' part. This causes the URL
        // object to treat this like a remote resource
        if(wsdlLocation.indexOf("/") == 0) {
            wsdlLocation = wsdlLocation.substring(1, wsdlLocation.length());
        }

        String fullWsdlLocation = "http:/" + wsdlLocation;
       
        WebServiceClientAnnot wsClientAnno = WebServiceClientAnnot.createWebServiceClientAnnotImpl(null, null, fullWsdlLocation);
        composite.setWebServiceClientAnnot(wsClientAnno);
        ServiceDelegate.setServiceMetadata(composite);

        try {
            Service service = new ClientMetadataGeneratedService();
            fail("Should have caught exception for invalid WSDL file name in override");
View Full Code Here


    /**
     * The overide WSDL file doesn't exist; should catch an error
     */
    public void testInvalidWsdlLocationOverride() {
        DescriptionBuilderComposite composite = new DescriptionBuilderComposite();
        WebServiceClientAnnot wsClientAnno = WebServiceClientAnnot.createWebServiceClientAnnotImpl(null, null, getWsdlLocation("InvalidFileName.wsdl"));
        composite.setWebServiceClientAnnot(wsClientAnno);
        ServiceDelegate.setServiceMetadata(composite);

        try {
            Service service = new ClientMetadataGeneratedService();
            fail("Should have caught exception for invalid WSDL file name in override");
View Full Code Here

            assertNull(ServiceDelegate.getServiceMetadata());
            ServiceDescription serviceDesc1 = serviceDelegate1.getServiceDescription();
            validatePort(service1, otherWsdl_portLocalPart);

            // Create the second service specifiying a sparse composite
            DescriptionBuilderComposite sparseComposite = new DescriptionBuilderComposite();
            ServiceDelegate.setServiceMetadata(sparseComposite);
            Service service2 = Service.create(wsdlUrl, serviceQName);
            ServiceDelegate serviceDelegate2 = DescriptionTestUtils2.getServiceDelegate(service2);
            assertNull(ServiceDelegate.getServiceMetadata());
            ServiceDescription serviceDesc2 = serviceDelegate2.getServiceDescription();
View Full Code Here

            installCachingFactory();
            QName serviceQName = new QName(namespaceURI, svcLocalPart);
            URL wsdlUrl = ClientMetadataTest.getWsdlURL(otherWsdl);
           
            // Create the first service
            DescriptionBuilderComposite sparseComposite1 = new DescriptionBuilderComposite();
            ServiceDelegate.setServiceMetadata(sparseComposite1);
            Service service1 = Service.create(wsdlUrl, serviceQName);
            ServiceDelegate serviceDelegate1 = DescriptionTestUtils2.getServiceDelegate(service1);
            assertNull(ServiceDelegate.getServiceMetadata());
            ServiceDescription serviceDesc1 = serviceDelegate1.getServiceDescription();
            validatePort(service1, otherWsdl_portLocalPart);

            // Create the second service specifiying a sparse composite
            DescriptionBuilderComposite sparseComposite2 = new DescriptionBuilderComposite();
            ServiceDelegate.setServiceMetadata(sparseComposite2);
            Service service2 = Service.create(wsdlUrl, serviceQName);
            ServiceDelegate serviceDelegate2 = DescriptionTestUtils2.getServiceDelegate(service2);
            assertNull(ServiceDelegate.getServiceMetadata());
            ServiceDescription serviceDesc2 = serviceDelegate2.getServiceDescription();
View Full Code Here

    public void testMultipleGeneratedServiceWithMultipleComposite() {
        try {
            installCachingFactory();
           
            // Create the first service with a sparse composite
            DescriptionBuilderComposite sparseComposite1 = new DescriptionBuilderComposite();
            ServiceDelegate.setServiceMetadata(sparseComposite1);
            Service service1 = new ClientMetadataGeneratedService(getWsdlURL(otherWsdl),
                                                                 new QName(namespaceURI, svcLocalPart));
            assertNotNull(service1);
            assertNull(ServiceDelegate.getServiceMetadata());
           
            // Create the second service with a sparse composite
            DescriptionBuilderComposite sparseComposite2 = new DescriptionBuilderComposite();
            ServiceDelegate.setServiceMetadata(sparseComposite2);
            Service service2 = new ClientMetadataGeneratedService(getWsdlURL(otherWsdl),
                                                                 new QName(namespaceURI, svcLocalPart));
            assertNotNull(service2);
            assertNull(ServiceDelegate.getServiceMetadata());
           
            // Verifiy the service delegates are different and the service descriptions are the same
            // since we installed a caching factory above.
            ServiceDelegate serviceDelegate1 = DescriptionTestUtils2.getServiceDelegate(service1);
            assertNotNull(serviceDelegate1);
            ServiceDescription serviceDesc1 = serviceDelegate1.getServiceDescription();
            assertNotNull(serviceDesc1);
           
            ServiceDelegate serviceDelegate2 = DescriptionTestUtils2.getServiceDelegate(service2);
            assertNotNull(serviceDelegate2);
            ServiceDescription serviceDesc2 = serviceDelegate2.getServiceDescription();
            assertNotNull(serviceDesc2);
           
            assertNotSame(serviceDelegate1, serviceDelegate2);
            assertSame(serviceDesc1, serviceDesc2);

            // There should be a sparse composite for the first service delegate and
            // one for the second service delegate
            assertSame(sparseComposite1,
                       DescriptionTestUtils2.getServiceDescriptionComposite(serviceDesc2).getSparseComposite(serviceDelegate1));
            assertSame(sparseComposite2, DescriptionTestUtils2.getServiceDescriptionComposite(serviceDesc2).getSparseComposite(serviceDelegate2));

           
            DescriptionBuilderComposite dbcInServiceDesc = DescriptionTestUtils2.getServiceDescriptionComposite(serviceDesc1);
            assertEquals(ClientMetadataGeneratedService.class, dbcInServiceDesc.getCorrespondingClass());

            // WSDL was specified on the generated Service constructor, and none in the composite
            // so should get the WSDL specified on the constructor
            assertTrue("Wrong WSDL used", validatePort(service1, otherWsdl_portLocalPart));
            assertTrue("Wrong WSDL used", validatePort(service2, otherWsdl_portLocalPart));
View Full Code Here

       
        Class endPointClass = classLoader.loadClass(endpointClassName);
        JavaClassToDBCConverter converter = new JavaClassToDBCConverter(endPointClass);
        HashMap<String, DescriptionBuilderComposite> dbcMap = converter.produceDBC();
      
        DescriptionBuilderComposite dbc = dbcMap.get(endpointClassName);
        dbc.setClassLoader(classLoader);
        dbc.setWsdlDefinition(wsdlDefinition);
        dbc.setClassName(endpointClassName);
        dbc.setCustomWsdlGenerator(new WSDLGeneratorImpl(wsdlDefinition));
       
        if (dbc.getWebServiceAnnot() != null) { //information specified in .wsdl should overwrite annotation.
            WebServiceAnnot serviceAnnot = dbc.getWebServiceAnnot();
            serviceAnnot.setPortName(portQName.getLocalPart());
            serviceAnnot.setServiceName(serviceQName.getLocalPart());
            serviceAnnot.setTargetNamespace(serviceQName.getNamespaceURI());
            if (dbc.getBindingTypeAnnot() !=null && bindingS != null && !bindingS.equals("")) {
                BindingTypeAnnot bindingAnnot = dbc.getBindingTypeAnnot();
                bindingAnnot.setValue(bindingS);
            }
        } else if (dbc.getWebServiceProviderAnnot() != null) {
            WebServiceProviderAnnot serviceProviderAnnot = dbc.getWebServiceProviderAnnot();
            serviceProviderAnnot.setPortName(portQName.getLocalPart());
            serviceProviderAnnot.setServiceName(serviceQName.getLocalPart());
            serviceProviderAnnot.setTargetNamespace(serviceQName.getNamespaceURI());
            if (dbc.getBindingTypeAnnot() !=null && bindingS != null && !bindingS.equals("")) {
                BindingTypeAnnot bindingAnnot = dbc.getBindingTypeAnnot();
                bindingAnnot.setValue(bindingS);
            }
        }

        AxisService service = getService(dbcMap);      
       
        service.setName(serviceQName.getLocalPart());
        service.setEndpointName(portQName.getLocalPart());
       
        for(Iterator<AxisOperation> opIterator = service.getOperations() ; opIterator.hasNext() ;){
            AxisOperation operation = opIterator.next();
            operation.setMessageReceiver(this.messageReceiver);
            String MEP = operation.getMessageExchangePattern();
            if (!WSDLUtil.isOutputPresentForMEP(MEP)) {
                List<MethodDescriptionComposite> mdcList = dbc.getMethodDescriptionComposite(operation.getName().toString());
                for(Iterator<MethodDescriptionComposite> mIterator = mdcList.iterator(); mIterator.hasNext();){
                    MethodDescriptionComposite mdc = mIterator.next();
                    //TODO: JAXWS spec says need to check Holder param exist before taking a method as OneWay
                    mdc.setOneWayAnnot(true);
                }
View Full Code Here

     * @param sei
     * @param parent
     */
    EndpointInterfaceDescriptionImpl(Class sei, EndpointDescriptionImpl parent) {
        parentEndpointDescription = parent;
        dbc = new DescriptionBuilderComposite();
        dbc.setCorrespondingClass(sei);

        // Per JSR-181 all methods on the SEI are mapped to operations regardless
        // of whether they include an @WebMethod annotation.  That annotation may
        // be present to customize the mapping, but is not required (p14)
View Full Code Here

     *
     * @param parent
     */
    EndpointInterfaceDescriptionImpl(EndpointDescriptionImpl parent) {
        parentEndpointDescription = parent;
        dbc = new DescriptionBuilderComposite();
        AxisService axisService = parentEndpointDescription.getAxisService();
        if (axisService != null) {
            ArrayList publishedOperations = axisService.getPublishedOperations();
            Iterator operationsIterator = publishedOperations.iterator();
            while (operationsIterator.hasNext()) {
View Full Code Here

            if (webFaultClassNames != null) {
                for (String wfClassName : webFaultClassNames) {
                    //  Try to find this exception class in the dbc list. If we can't find it
                    //  then just assume that its a generic exception.

                    DescriptionBuilderComposite faultDBC = dbcMap.get(wfClassName);

                    if (faultDBC != null) {
                        // JAXWS 3.7 does not require @WebFault annotation
                        // We found a valid exception composite thats annotated
                        buildFaultList.add(new FaultDescriptionImpl(faultDBC, this));
View Full Code Here

        if (!javax.xml.ws.Service.class.isAssignableFrom(serviceClass)) {
            throw ExceptionFactory.makeWebServiceException(
                    Messages.getMessage("serviceDescErr1", serviceClass.getName()));
        }

        composite = new DescriptionBuilderComposite();
        composite.setIsServiceProvider(false);
        composite.setCorrespondingClass(serviceClass);
        // The classloader was originally gotten off this class, but it seems more logical to
        // get it off the application service class.
//        composite.setClassLoader(this.getClass().getClassLoader());
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.