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

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


    public ServiceProcessor(ToolContext penv) {
        super(penv);
    }

    public void process(ServiceInfo si) throws ToolException {
        jaxwsBinding = new JAXWSBinding();
        this.service = si;
        if (si.getName() == null) {
            processBindings(context.get(JavaModel.class));
        } else {
            processService(context.get(JavaModel.class));
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();               
                }
                if (serviceBinding2.getJaxwsClass().getComments() != null) {
                    jaxwsBinding.setClassJavaDoc(serviceBinding2.getJaxwsClass().getComments());
                }
                if (!serviceBinding2.getPackageJavaDoc().equals("")) {
                    sclz.setPackageJavaDoc(serviceBinding2.getPackageJavaDoc());
                }
            }
           
            sclz.setServiceName(service.getName().getLocalPart());
            sclz.setNamespace(namespace);
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.getJaxwsParas() != null) {
                jaxwsBinding.setJaxwsParas(bopBinding.getJaxwsParas());
            }
        }
        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

                                       InterfaceInfo interfaceInfo) throws ToolException {
        JavaInterface intf = interfaceInfo.getProperty("JavaInterface", JavaInterface.class);
        if (intf == null) {
            intf = new InterfaceMapper(context).map(interfaceInfo);

            JAXWSBinding jaxwsBinding = null;
            if (serviceInfo.getDescription() != null) {
                jaxwsBinding = serviceInfo.getDescription().getExtensor(JAXWSBinding.class);
            }
            JAXWSBinding infBinding = interfaceInfo.getExtensor(JAXWSBinding.class);
            if (infBinding != null && infBinding.getPackage() != null) {
                intf.setPackageName(infBinding.getPackage());
            } else if (jaxwsBinding != null && jaxwsBinding.getPackage() != null) {
                intf.setPackageName(jaxwsBinding.getPackage());
            }
           
            if (infBinding != null && !infBinding.getPackageJavaDoc().equals("")) {
                intf.setPackageJavaDoc(infBinding.getPackageJavaDoc());
            } else if (jaxwsBinding != null && !jaxwsBinding.getPackageJavaDoc().equals("")) {
                intf.setPackageJavaDoc(jaxwsBinding.getPackageJavaDoc());
            }

            String name = intf.getName();
            if (infBinding != null
                && infBinding.getJaxwsClass() != null
                && infBinding.getJaxwsClass().getClassName() != null) {
                name = infBinding.getJaxwsClass().getClassName();
                intf.setClassJavaDoc(infBinding.getJaxwsClass().getComments());
            }

            ClassCollector collector = context.get(ClassCollector.class);
            if (context.optionSet(ToolConstants.CFG_AUTORESOLVE)) {
                int count = 0;
View Full Code Here

            } catch (Exception e) {
                LOG.log(Level.WARNING, new Message("SOAP_MISSING", LOG).toString());
            }
        }

        JAXWSBinding mBinding = inputMessage.getOperation().getExtensor(JAXWSBinding.class);
        for (MessagePartInfo part : inputMessage.getMessageParts()) {
            if (isOutOfBandHeader(part) && !requireOutOfBandHeader()) {
                continue;
            }
            JavaParameter param = getParameterFromPart(method, part, JavaType.Style.IN);
            if (mBinding != null && mBinding.getJaxwsParas() != null) {
                for (JAXWSParameter jwp : mBinding.getJaxwsParas()) {
                    if (part.getName().getLocalPart().equals(jwp.getPart())) {
                        param.setName(jwp.getName());
                    }
                }
            }
View Full Code Here

        List<QName> wrappedElements = ProcessorUtil.getWrappedElementQNames(context, part.getElementQName());
        if ((wrappedElements == null || wrappedElements.size() == 0)
            && countOutOfBandHeader(inputMessage) == 0) {
            return;
        }
        JAXWSBinding mBinding = inputMessage.getOperation().getExtensor(JAXWSBinding.class);
        for (QName item : wrappedElements) {
            JavaParameter jp = getParameterFromQName(part.getElementQName(),
                                  item, JavaType.Style.IN, part);
            if (mBinding != null && mBinding.getJaxwsParas() != null) {
                for (JAXWSParameter jwsp : mBinding.getJaxwsParas()) {
                    if (item.equals(jwsp.getElementName())) {
                        jp.setName(jwsp.getName());
                    }
                }
            }
View Full Code Here

                processReturn(method, outParts.get(0));
                outParts.remove(0);
            } else {
                processReturn(method, null);
            }
            JAXWSBinding mBinding = outputMessage.getOperation().getExtensor(JAXWSBinding.class);
            for (MessagePartInfo part : outParts) {

                JavaParameter param = getParameterFromPart(method, part, JavaType.Style.OUT);
                if (mBinding != null && mBinding.getJaxwsParas() != null) {
                    for (JAXWSParameter jwp : mBinding.getJaxwsParas()) {
                        if (part.getName().getLocalPart().equals(jwp.getPart())) {
                            param.setName(jwp.getName());
                        }
                    }
                }
View Full Code Here

                                                          JavaType.Style.OUT, outputPart);
                if (!qualified) {
                    jp.setTargetNamespace("");
                }
               
                JAXWSBinding mBinding = outputMessage.getOperation().getExtensor(JAXWSBinding.class);
                if (mBinding != null && mBinding.getJaxwsParas() != null) {
                    for (JAXWSParameter jwsp : mBinding.getJaxwsParas()) {
                        if (outElement.equals(jwsp.getElementName())) {
                            jp.setName(jwsp.getName());
                        }
                    }
                }
View Full Code Here

            } catch (Exception e) {
                LOG.log(Level.WARNING, new Message("SOAP_MISSING", LOG).toString());
            }
        }

        JAXWSBinding mBinding = inputMessage.getOperation().getExtensor(JAXWSBinding.class);
        for (MessagePartInfo part : inputMessage.getMessageParts()) {
            if (isOutOfBandHeader(part) && !requireOutOfBandHeader()) {
                continue;
            }
            JavaParameter param = getParameterFromPart(method, part, JavaType.Style.IN);
            if (mBinding != null && mBinding.getJaxwsParas() != null) {
                for (JAXWSParameter jwp : mBinding.getJaxwsParas()) {
                    if (part.getName().getLocalPart().equals(jwp.getPart())) {
                        param.setName(jwp.getName());
                    }
                }
            }
View Full Code Here

                processReturn(method, outParts.get(0));
                outParts.remove(0);
            } else {
                processReturn(method, null);
            }
            JAXWSBinding mBinding = outputMessage.getOperation().getExtensor(JAXWSBinding.class);
            for (MessagePartInfo part : outParts) {

                JavaParameter param = getParameterFromPart(method, part, JavaType.Style.OUT);
                if (mBinding != null && mBinding.getJaxwsParas() != null) {
                    for (JAXWSParameter jwp : mBinding.getJaxwsParas()) {
                        if (part.getName().getLocalPart().equals(jwp.getPart())) {
                            param.setName(jwp.getName());
                        }
                    }
                }
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.