Examples of JAXWSBinding


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

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

            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 (name.contains(".")) {
                        jaxwsBinding.setPackage(name.substring(0, name.lastIndexOf('.')));
                        name = name.substring(name.lastIndexOf('.') + 1);
                    }
                   
                    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 (name.contains(".")) {
                        jaxwsBinding.setPackage(name.substring(0, name.lastIndexOf('.')));
                        name = name.substring(name.lastIndexOf('.') + 1);
                    }
                }
                if (serviceBinding2.getJaxwsClass() != null
                    && 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

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

        Collection<BindingOperationInfo> operations = binding.getOperations();
        for (BindingOperationInfo bop : operations) {
            processOperation(model, bop, binding);
        }
        jport.setJavaDoc(port.getDocumentation());
        JAXWSBinding bind = port.getExtensor(JAXWSBinding.class);
        if (bind != null) {
            jport.setMethodName(bind.getMethodName());
            jport.setJavaDoc(bind.getMethodJavaDoc());
        }
       
        return jport;
    }
View Full Code Here

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


    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<String, Object> 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 = opinfo.getExtensor(JAXWSBinding.class);
                JAXWSBinding infBinding = opinfo.getInterface().getExtensor(JAXWSBinding.class);
                boolean enableMime = enableOpMime;
                boolean enableWrapperStyle = true;
               
                if (infBinding != null && infBinding.isSetEnableWrapperStyle()) {
                    enableWrapperStyle = infBinding.isEnableWrapperStyle();
                }
                if (infBinding != null && infBinding.isSetEnableMime()) {
                    enableMime = infBinding.isEnableMime();
                }
                if (opBinding != null && opBinding.isSetEnableWrapperStyle()) {
                    enableWrapperStyle = opBinding.isEnableWrapperStyle();
                }
                if (opBinding != null && opBinding.isSetEnableMime()) {
View Full Code Here

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

        String operationName = operation.getName().getLocalPart();

        method.setName(ProcessorUtil.mangleNameToVariableName(operationName));
        method.setOperationName(operationName);

        JAXWSBinding opBinding = operation.getExtensor(JAXWSBinding.class);
        if (opBinding != null
            && opBinding.getMethodName() != null) {
            method.setName(opBinding.getMethodName());
        }
       
        if (opBinding != null
            && opBinding.getMethodJavaDoc() != null) {
            method.setJavaDoc(opBinding.getMethodJavaDoc());
        } else {
            method.setJavaDoc(operation.getDocumentation());
        }

        if (operation.isOneWay()) {
View Full Code Here

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

        List defExtensionList = customizedDef.getExtensibilityElements();
        Iterator ite = defExtensionList.iterator();

        while (ite.hasNext()) {
            ExtensibilityElement extElement = (ExtensibilityElement)ite.next();
            JAXWSBinding binding = (JAXWSBinding)extElement;
            assertEquals("Customized package name does not been parsered", "com.foo", binding.getPackage());
            assertEquals("Customized enableAsync does not parsered", true, binding.isEnableAsyncMapping());
        }

        PortType portType = customizedDef.getPortType(new QName("http://apache.org/hello_world_soap_http",
                                                                "Greeter"));

        List portTypeList = portType.getExtensibilityElements();
        JAXWSBinding binding = (JAXWSBinding)portTypeList.get(0);

        assertEquals("Customized enable EnableWrapperStyle name does not been parsered", true, binding
            .isEnableWrapperStyle());

        List opList = portType.getOperations();
        Operation operation = (Operation)opList.get(0);
        List extList = operation.getExtensibilityElements();
        binding = (JAXWSBinding)extList.get(0);

        assertEquals("Customized method name does not parsered", "echoMeOneWay", binding.getMethodName());


        assertEquals("Customized parameter element name does not parsered", "number1", binding
            .getJaxwsParas().get(0).getElementName().getLocalPart());
        assertEquals("Customized parameter message name does not parsered", "greetMeOneWayRequest", binding
            .getJaxwsParas().get(0).getMessageName());
        assertEquals("customized parameter name does not parsered", "num1",
                     binding.getJaxwsParas().get(0).getName());
    }
View Full Code Here

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

        List defExtensionList = customizedDef.getExtensibilityElements();
        Iterator ite = defExtensionList.iterator();

        while (ite.hasNext()) {
            ExtensibilityElement extElement = (ExtensibilityElement)ite.next();
            JAXWSBinding binding = (JAXWSBinding)extElement;
            assertEquals("Customized package name does not been parsered", "com.foo", binding.getPackage());
            assertEquals("Customized enableAsync does not parsered", true, binding.isEnableAsyncMapping());
        }

        PortType portType = customizedDef.getPortType(new QName("http://apache.org/hello_world_soap_http",
                                                                "Greeter"));

        List portTypeList = portType.getExtensibilityElements();
        JAXWSBinding binding = (JAXWSBinding)portTypeList.get(0);

        assertEquals("Customized enable EnableWrapperStyle name does not been parsered", true, binding
            .isEnableWrapperStyle());

        List opList = portType.getOperations();
        Operation operation = (Operation)opList.get(0);
        List extList = operation.getExtensibilityElements();
        binding = (JAXWSBinding)extList.get(0);

        assertEquals("Customized method name does not parsered", "echoMeOneWay", binding.getMethodName());


        assertEquals("Customized parameter element name does not parsered", "number1", binding
            .getJaxwsParas().get(0).getElementName().getLocalPart());
        assertEquals("Customized parameter message name does not parsered", "greetMeOneWayRequest", binding
            .getJaxwsParas().get(0).getMessageName());
        assertEquals("customized parameter name does not parsered", "num1",
                     binding.getJaxwsParas().get(0).getName());
    }
View Full Code Here

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

        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

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

        String operationName = operation.getName().getLocalPart();

        method.setName(ProcessorUtil.mangleNameToVariableName(operationName));
        method.setOperationName(operationName);
       
        JAXWSBinding opBinding = operation.getExtensor(JAXWSBinding.class);
        if (opBinding != null
            && opBinding.getMethodName() != null) {
            method.setName(opBinding.getMethodName());
        }


        if (operation.isOneWay()) {
            method.setStyle(OperationType.ONE_WAY);
View Full Code Here

Examples of org.objectweb.celtix.tools.extensions.jaxws.JAXWSBinding

        return msg;
    }

    private void doCustomizeBinding(JavaModel jmodel, JavaInterface ji, Binding binding) {
        JAXWSBinding bindingExt = null;
        List extElements = binding.getExtensibilityElements();
        if (extElements.size() > 0) {
            Iterator iterator = extElements.iterator();
            while (iterator.hasNext()) {
                Object obj = iterator.next();
                if (obj instanceof JAXWSBinding) {
                    bindingExt = (JAXWSBinding)obj;
                    ji.setBindingExt(bindingExt);
                    return;
                }
            }
        }
        String portTypeName = binding.getPortType().getQName().getLocalPart();
        bindingExt = CustomizationParser.getInstance().getPortTypeExtension(portTypeName);
        if (bindingExt != null) {
            if (!bindingExt.isSetMimeEnable() && jmodel.getJAXWSBinding().isSetMimeEnable()
                && jmodel.getJAXWSBinding().isEnableMime()) {
                bindingExt.setSetMimeEnable(true);
                bindingExt.setEnableMime(true);
            }
        } else if (jmodel.getJAXWSBinding() != null) {
            bindingExt = new JAXWSBinding();
            if (jmodel.getJAXWSBinding().isSetMimeEnable() && jmodel.getJAXWSBinding().isEnableMime()) {
                bindingExt.setSetMimeEnable(true);
                bindingExt.setEnableMime(true);
            }
        } else {
            // TBD: There is no extensibilityelement in port type
            bindingExt = new JAXWSBinding();
        }
        ji.setBindingExt(bindingExt);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.