Package org.apache.cxf.tools.wsdlto.frontend.jaxws.customization

Examples of org.apache.cxf.tools.wsdlto.frontend.jaxws.customization.JAXWSBinding


        if (namespace.equals(method.getInterface().getNamespace())) {
            packageName = method.getInterface().getPackageName();
        }


        JAXWSBinding jaxwsBinding = faultMessage.getExtensor(JAXWSBinding.class);
        if (jaxwsBinding != null) {
            if (jaxwsBinding.getPackage() != null) {
                packageName = jaxwsBinding.getPackage();
            }
            if (jaxwsBinding.getJaxwsClass() != null
                && jaxwsBinding.getJaxwsClass().getClassName() != null) {
                name = jaxwsBinding.getJaxwsClass().getClassName();
                if (name.contains(".")) {
                    packageName = name.substring(0, name.lastIndexOf('.'));
                    name = name.substring(name.lastIndexOf('.') + 1);
                }
            }
View Full Code Here


        boolean valid = false;
        if (operation.getUnwrappedOperation() == null) {
            valid = true;
        }
       
        JAXWSBinding binding = (JAXWSBinding)operation.getExtensor(JAXWSBinding.class);
        if (binding != null && !binding.isEnableWrapperStyle()) {
            valid = true;
        }
        binding = operation.getInterface().getExtensor(JAXWSBinding.class);
        if (binding != null && !binding.isEnableWrapperStyle()) {
            valid = true;
        }
        binding = operation.getInterface().getService()
            .getDescription().getExtensor(JAXWSBinding.class);
        if (binding != null && !binding.isEnableWrapperStyle()) {
            valid = true;
        }
       
        if (valid) {
            return true;
View Full Code Here

            method.annotate(new WrapperAnnotator(wrapperRequest, wrapperResponse));
        }

        method.annotate(new WebResultAnnotator());

        JAXWSBinding opBinding = (JAXWSBinding)operation.getExtensor(JAXWSBinding.class);

        boolean enableAsync = false;
        if (globalBinding != null && globalBinding.isEnableAsyncMapping()
            || opBinding != null && opBinding.isEnableAsyncMapping()) {
            enableAsync = true;
        }


        if (!method.isOneWay()
            && enableAsync && !isAddedAsyMethod(method)) {
            addAsyncMethod(method);
        }

        if (globalBinding != null && globalBinding.isEnableMime()
            || opBinding != null && opBinding.isEnableMime()) {
            method.setMimeEnable(true);
        }
    }
View Full Code Here

        String namespace = service.getName().getNamespaceURI();
        String packageName = ProcessorUtil.parsePackageName(namespace, context.mapPackageName(namespace));


        //customizing
        JAXWSBinding serviceBinding = null;
        if (service.getDescription() != null) {
            serviceBinding = service.getDescription().getExtensor(JAXWSBinding.class);
        }
        JAXWSBinding serviceBinding2 = service.getExtensor(JAXWSBinding.class);

        //TODO : Handle service customized class
        if (serviceBinding != null) {
            if (serviceBinding.getPackage() != null) {
                jaxwsBinding.setPackage(serviceBinding.getPackage());
            }

            if (serviceBinding.isEnableAsyncMapping()) {
                jaxwsBinding.setEnableAsyncMapping(true);
            }

            if (serviceBinding.isEnableMime()) {
                jaxwsBinding.setEnableMime(true);
            }
            jaxwsBinding.setEnableWrapperStyle(serviceBinding.isEnableWrapperStyle());

            if (serviceBinding.getJaxwsClass() != null
                && serviceBinding.getJaxwsClass().getClassName() != null) {
                name = serviceBinding.getJaxwsClass().getClassName()
                sclz.setClassJavaDoc(serviceBinding.getJaxwsClass().getComments());         
            }
            sclz.setPackageJavaDoc(serviceBinding.getPackageJavaDoc());
        }
        if (serviceBinding2 != null) {
            if (serviceBinding2.getPackage() != null) {
                jaxwsBinding.setPackage(serviceBinding2.getPackage());
            }

            if (serviceBinding2.isEnableAsyncMapping()) {
                jaxwsBinding.setEnableAsyncMapping(true);
            }

            if (serviceBinding2.isEnableMime()) {
                jaxwsBinding.setEnableMime(true);
            }

            if (serviceBinding2.isEnableWrapperStyle()) {
                jaxwsBinding.setEnableWrapperStyle(true);
            }
            if (serviceBinding2.getJaxwsClass() != null
                && serviceBinding2.getJaxwsClass().getClassName() != null) {
                name = serviceBinding2.getJaxwsClass().getClassName();               
                sclz.setClassJavaDoc(serviceBinding2.getJaxwsClass().getComments());
            }
            if (!serviceBinding2.getPackageJavaDoc().equals("")) {
                sclz.setPackageJavaDoc(serviceBinding2.getPackageJavaDoc());
            }
        }
       
        sclz.setServiceName(service.getName().getLocalPart());
        sclz.setNamespace(namespace);
View Full Code Here

        InterfaceInfo infInfo = binding.getInterface();

        String portType = binding.getInterface().getName().getLocalPart();
        jport.setPortType(portType);

        JAXWSBinding infBinding = infInfo.getExtensor(JAXWSBinding.class);

        if (infBinding != null) {
            if (infBinding.getJaxwsClass() != null
                && !StringUtils.isEmpty(infBinding.getJaxwsClass().getClassName())) {
                jport.setPortType(infBinding.getJaxwsClass().getClassName());
                jaxwsBinding.setClassJavaDoc(infBinding.getJaxwsClass().getComments());
            }

            if (!infBinding.isEnableAsyncMapping()) {
                jaxwsBinding.setEnableAsyncMapping(false);
            }
            if (!infBinding.isEnableWrapperStyle()) {
                jaxwsBinding.setEnableWrapperStyle(false);
            }

            if (infBinding.getPackage() != null) {
                jaxwsBinding.setPackage(infBinding.getPackage());
            }
           
            if (!infBinding.getPackageJavaDoc().equals("")) {
                jaxwsBinding.setPackageJavaDoc(infBinding.getPackageJavaDoc());
            }
        }

        if (jaxwsBinding.getPackage() != null) {
            jport.setPackageName(jaxwsBinding.getPackage());
        }

        if (infBinding != null && infBinding.getJaxwsClass() != null
            && infBinding.getJaxwsClass().getClassName() != null) {
            String className = NameUtil.mangleNameToClassName(infBinding.getJaxwsClass().getClassName());
            jport.setInterfaceClass(className);
        } else {
            jport.setInterfaceClass(NameUtil.mangleNameToClassName(portType));
        }
View Full Code Here

    }

    private void processOperation(JavaModel model, BindingOperationInfo bop, BindingInfo binding)
        throws ToolException {
        boolean enableOpMime = false;
        JAXWSBinding bind = binding.getExtensor(JAXWSBinding.class);

        if (bind != null && bind.isEnableMime()) {
            enableOpMime = true;
        }

        JAXWSBinding bopBinding = bop.getExtensor(JAXWSBinding.class);

        if (bopBinding != null && bopBinding.isEnableMime()) {
            enableOpMime = true;
            if (bopBinding.getJaxwsPara() != null) {
                jaxwsBinding.setJaxwsPara(bopBinding.getJaxwsPara());
            }
        }
        JavaInterface jf = null;
        for (JavaInterface jf2 : model.getInterfaces().values()) {
            if (binding.getInterface().getName().getLocalPart()
                    .equals(jf2.getWebServiceName())) {
                jf = jf2;
            }
        }
        if (isSoapBinding()) {
            SoapBinding soapBinding = (SoapBinding)bindingObj;
            if (SOAPBindingUtil.getSoapStyle(soapBinding.getStyle()) == null) {
                jf.setSOAPStyle(javax.jws.soap.SOAPBinding.Style.DOCUMENT);
            } else {
                jf.setSOAPStyle(SOAPBindingUtil.getSoapStyle(soapBinding.getStyle()));
            }
        } else {
            // REVISIT: fix for xml binding
            jf.setSOAPStyle(javax.jws.soap.SOAPBinding.Style.DOCUMENT);
        }

        Object[] methods = jf.getMethods().toArray();
        for (int i = 0; i < methods.length; i++) {
            JavaMethod jm = (JavaMethod)methods[i];
            if (jm.getOperationName() != null && jm.getOperationName().equals(bop.getName().getLocalPart())) {
                if (isSoapBinding()) {
                    // TODO: add customize here
                    //doCustomizeOperation(jf, jm, bop);
                    Map prop = getSoapOperationProp(bop);
                    String soapAction = prop.get(soapOPAction) == null ? "" : (String)prop.get(soapOPAction);
                    String soapStyle = prop.get(soapOPStyle) == null ? "" : (String)prop.get(soapOPStyle);
                    jm.setSoapAction(soapAction);
                    if (SOAPBindingUtil.getSoapStyle(soapStyle) == null && this.bindingObj == null) {
                        org.apache.cxf.common.i18n.Message msg =
                            new  org.apache.cxf.common.i18n.Message("BINDING_STYLE_NOT_DEFINED",
                                                                         LOG);
                        throw new ToolException(msg);
                    }
                    if (SOAPBindingUtil.getSoapStyle(soapStyle) == null) {
                        jm.setSoapStyle(jf.getSOAPStyle());
                    } else {
                        jm.setSoapStyle(SOAPBindingUtil.getSoapStyle(soapStyle));
                    }
                } else {
                    // REVISIT: fix for xml binding
                    jm.setSoapStyle(jf.getSOAPStyle());
                }

                if (jm.getSoapStyle().equals(javax.jws.soap.SOAPBinding.Style.RPC)) {
                    jm.getAnnotationMap().remove("SOAPBinding");
                }

                OperationProcessor processor = new OperationProcessor(context);

                int headerType = isNonWrappable(bop);

                OperationInfo opinfo = bop.getOperationInfo();

                JAXWSBinding opBinding = (JAXWSBinding)opinfo.getExtensor(JAXWSBinding.class);


                if (opBinding != null) {
                    if (opBinding.isEnableWrapperStyle()) {
                        jaxwsBinding.setEnableWrapperStyle(true);
                    } else {
                        jaxwsBinding.setEnableWrapperStyle(false);
                        if (!opBinding.isEnableAsyncMapping()) {
                            jaxwsBinding.setEnableAsyncMapping(false);
                        }
                    }

                    if (opBinding.isEnableMime()) {
                        enableOpMime = true;
                    }
                }
                if (jaxwsBinding.isEnableMime() || enableOpMime) {
                    jm.setMimeEnable(true);
View Full Code Here

        }

        method.annotate(new WebResultAnnotator());
        method.annotate(new SoapBindingAnnotator());               

        JAXWSBinding opBinding = (JAXWSBinding)operation.getExtensor(JAXWSBinding.class);

        boolean enableAsync = false;
        if (globalBinding != null && globalBinding.isEnableAsyncMapping()
            || opBinding != null && opBinding.isEnableAsyncMapping()) {
            enableAsync = true;
        }


        if (!method.isOneWay()
            && enableAsync && !isAddedAsyMethod(method)) {
            addAsyncMethod(method);
        }

        if (globalBinding != null && globalBinding.isEnableMime()
            || opBinding != null && opBinding.isEnableMime()) {
            method.setMimeEnable(true);
        }
    }
View Full Code Here

        String namespace = service.getName().getNamespaceURI();
        String packageName = ProcessorUtil.parsePackageName(namespace, context.mapPackageName(namespace));


        //customizing
        JAXWSBinding serviceBinding = null;
        if (service.getDescription() != null) {
            serviceBinding = service.getDescription().getExtensor(JAXWSBinding.class);
        }
        JAXWSBinding serviceBinding2 = service.getExtensor(JAXWSBinding.class);

        //TODO : Handle service customized class
        if (serviceBinding != null) {
            if (serviceBinding.getPackage() != null) {
                jaxwsBinding.setPackage(serviceBinding.getPackage());
            }

            if (serviceBinding.isEnableAsyncMapping()) {
                jaxwsBinding.setEnableAsyncMapping(true);
            }

            if (serviceBinding.isEnableMime()) {
                jaxwsBinding.setEnableMime(true);
            }
            jaxwsBinding.setEnableWrapperStyle(serviceBinding.isEnableWrapperStyle());

            if (serviceBinding.getJaxwsClass() != null
                && serviceBinding.getJaxwsClass().getClassName() != null) {
                name = serviceBinding.getJaxwsClass().getClassName();
            }
        }
        if (serviceBinding2 != null) {
            if (serviceBinding2.getPackage() != null) {
                jaxwsBinding.setPackage(serviceBinding2.getPackage());
            }

            if (serviceBinding2.isEnableAsyncMapping()) {
                jaxwsBinding.setEnableAsyncMapping(true);
            }

            if (serviceBinding2.isEnableMime()) {
                jaxwsBinding.setEnableMime(true);
            }

            if (serviceBinding2.isEnableWrapperStyle()) {
                jaxwsBinding.setEnableWrapperStyle(true);
            }
            if (serviceBinding2.getJaxwsClass() != null
                && serviceBinding2.getJaxwsClass().getClassName() != null) {
                name = serviceBinding2.getJaxwsClass().getClassName();
            }
        }

        sclz.setServiceName(service.getName().getLocalPart());
        sclz.setNamespace(namespace);
View Full Code Here

        InterfaceInfo infInfo = binding.getInterface();

        String portType = binding.getInterface().getName().getLocalPart();
        jport.setPortType(portType);

        JAXWSBinding infBinding = infInfo.getExtensor(JAXWSBinding.class);

        if (infBinding != null) {
            if (infBinding.getJaxwsClass() != null
                && !StringUtils.isEmpty(infBinding.getJaxwsClass().getClassName())) {
                jport.setPortType(infBinding.getJaxwsClass().getClassName());
            }

            if (!infBinding.isEnableAsyncMapping()) {
                jaxwsBinding.setEnableAsyncMapping(false);
            }
            if (!infBinding.isEnableWrapperStyle()) {
                jaxwsBinding.setEnableWrapperStyle(false);
            }

            if (infBinding.getPackage() != null) {
                jaxwsBinding.setPackage(infBinding.getPackage());
            }
        }

        if (jaxwsBinding.getPackage() != null) {
            jport.setPackageName(jaxwsBinding.getPackage());
        }

        if (infBinding != null && infBinding.getJaxwsClass() != null
            && infBinding.getJaxwsClass().getClassName() != null) {
            String className = NameUtil.mangleNameToClassName(infBinding.getJaxwsClass().getClassName());
            jport.setInterfaceClass(className);
        } else {
            jport.setInterfaceClass(NameUtil.mangleNameToClassName(portType));
        }
View Full Code Here

    }

    private void processOperation(JavaModel model, BindingOperationInfo bop, BindingInfo binding)
        throws ToolException {
        boolean enableOpMime = false;
        JAXWSBinding bind = binding.getExtensor(JAXWSBinding.class);

        if (bind != null && bind.isEnableMime()) {
            enableOpMime = true;
        }

        JAXWSBinding bopBinding = bop.getExtensor(JAXWSBinding.class);

        if (bopBinding != null && bopBinding.isEnableMime()) {
            enableOpMime = true;
            if (bopBinding.getJaxwsPara() != null) {
                jaxwsBinding.setJaxwsPara(bopBinding.getJaxwsPara());
            }
        }
        JavaInterface jf = null;
        for (JavaInterface jf2 : model.getInterfaces().values()) {
            if (binding.getInterface().getName().getLocalPart()
                    .equals(jf2.getWebServiceName())) {
                jf = jf2;
            }
        }
        if (isSoapBinding()) {
            SoapBinding soapBinding = (SoapBinding)bindingObj;
            if (SOAPBindingUtil.getSoapStyle(soapBinding.getStyle()) == null) {
                jf.setSOAPStyle(javax.jws.soap.SOAPBinding.Style.DOCUMENT);
            } else {
                jf.setSOAPStyle(SOAPBindingUtil.getSoapStyle(soapBinding.getStyle()));
            }
        } else {
            // REVISIT: fix for xml binding
            jf.setSOAPStyle(javax.jws.soap.SOAPBinding.Style.DOCUMENT);
        }

        Object[] methods = jf.getMethods().toArray();
        for (int i = 0; i < methods.length; i++) {
            JavaMethod jm = (JavaMethod)methods[i];
            if (jm.getOperationName() != null && jm.getOperationName().equals(bop.getName().getLocalPart())) {
                if (isSoapBinding()) {
                    // TODO: add customize here
                    //doCustomizeOperation(jf, jm, bop);
                    Map prop = getSoapOperationProp(bop);
                    String soapAction = prop.get(soapOPAction) == null ? "" : (String)prop.get(soapOPAction);
                    String soapStyle = prop.get(soapOPStyle) == null ? "" : (String)prop.get(soapOPStyle);
                    jm.setSoapAction(soapAction);
                    if (SOAPBindingUtil.getSoapStyle(soapStyle) == null && this.bindingObj == null) {
                        org.apache.cxf.common.i18n.Message msg =
                            new  org.apache.cxf.common.i18n.Message("BINDING_STYLE_NOT_DEFINED",
                                                                         LOG);
                        throw new ToolException(msg);
                    }
                    if (SOAPBindingUtil.getSoapStyle(soapStyle) == null) {
                        jm.setSoapStyle(jf.getSOAPStyle());
                    } else {
                        jm.setSoapStyle(SOAPBindingUtil.getSoapStyle(soapStyle));
                    }
                } else {
                    // REVISIT: fix for xml binding
                    jm.setSoapStyle(jf.getSOAPStyle());
                }

                if (jm.getSoapStyle().equals(javax.jws.soap.SOAPBinding.Style.RPC)) {
                    jm.getAnnotationMap().remove("SOAPBinding");
                }

                OperationProcessor processor = new OperationProcessor(context);

                int headerType = isNonWrappable(bop);

                OperationInfo opinfo = bop.getOperationInfo();

                JAXWSBinding opBinding = (JAXWSBinding)opinfo.getExtensor(JAXWSBinding.class);


                if (opBinding != null) {
                    if (opBinding.isEnableWrapperStyle()) {
                        jaxwsBinding.setEnableWrapperStyle(true);
                    } else {
                        jaxwsBinding.setEnableWrapperStyle(false);
                        if (!opBinding.isEnableAsyncMapping()) {
                            jaxwsBinding.setEnableAsyncMapping(false);
                        }
                    }

                    if (opBinding.isEnableMime()) {
                        enableOpMime = true;
                    }
                }
                if (jaxwsBinding.isEnableMime() || enableOpMime) {
                    jm.setMimeEnable(true);
View Full Code Here

TOP

Related Classes of org.apache.cxf.tools.wsdlto.frontend.jaxws.customization.JAXWSBinding

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.