Package org.objectweb.celtix.tools.common

Examples of org.objectweb.celtix.tools.common.ToolException


        if (!method.getDeclaringClass().equals(seiClass)) {
            try {
                Method tmp = seiClass.getMethod(method.getName(), (Class[])method.getParameterTypes());
                operationName = tmp.getName();
            } catch (NoSuchMethodException e) {
                throw new ToolException(e.getMessage(), e);
            }
        }

        if (webMethod != null) {
            operationName = webMethod.operationName().length() > 0
                ? webMethod.operationName() : operationName;
        }

        javaMethod.setName(operationName);
        javaMethod.setSoapAction(webMethod.action());

       
        if (isAsynMethod(method)) {
            return;
        }
       
        if (isOneWayMethod(method)) {
            javaMethod.setStyle(OperationType.ONE_WAY);
        } else {
            javaMethod.setStyle(OperationType.REQUEST_RESPONSE);
        }

        switch (getMethodType(method)) {
        case WSDLConstants.DOC_BARE:
            DocBareMethodProcessor docBareProcessor = new DocBareMethodProcessor(model);
            docBareProcessor.processDocBare(javaMethod, method);
            break;
        case WSDLConstants.DOC_WRAPPED:
            DocWrapperMethodProcessor docWrapperProcessor = new DocWrapperMethodProcessor(model);
            docWrapperProcessor.process(javaMethod, method);
            break;
        case WSDLConstants.RPC_WRAPPED:
            RPCMethodProcessor rpcMethodProcessor = new RPCMethodProcessor(model);
            rpcMethodProcessor.process(javaMethod, method);
            break;
        default:
            Message message = new Message("SOAPUSESTYLE_PARAMETERSTYLE_ERROR", LOG, method.getName());
            throw new ToolException(message);
        }
        wmodel.addJavaMethod(javaMethod);
    }
View Full Code Here


    private void populateWSDLInfo(Class clazz) {
        WebService webService = AnnotationUtil.getPrivClassAnnotation(clazz, WebService.class);
        if (webService == null) {
            Message message = new Message("SEI_CLASS_NO_WEBSERVICE_ANNOTATED", LOG);
            throw new ToolException(message);

        }
        if (webService.endpointInterface().length() > 0) {
            clazz = AnnotationUtil.loadClass(webService.endpointInterface(), clazz.getClassLoader());
            webService = AnnotationUtil.getPrivClassAnnotation(clazz, WebService.class);
            if (webService == null) {
                Message message = new Message("SEI_INTERFACE_NO_WEBSERVICE_ANNOTATED", LOG);
                throw new ToolException(message);
            }
        }

        String portTypeName = clazz.getSimpleName() + "PortType";
        if (webService.name().length() > 0) {
            portTypeName = webService.name();
        }

        model.setPortTypeName(portTypeName);

        String portName = clazz.getSimpleName() + "Port";

        if (webService.portName().length() > 0) {
            portName = webService.portName();
        } else if (webService.name().length() > 0) {
            portName = webService.name() + "Port";

        }
        model.setPortName(portName);

        String serviceName = clazz.getSimpleName() + "Service";
        if (env.optionSet(ToolConstants.CFG_SERVICENAME)) {
            serviceName = (String)env.get(ToolConstants.CFG_SERVICENAME);
        } else {
            if (webService.serviceName().length() > 0) {
                serviceName = webService.serviceName();
            }
        }
        model.setServiceName(serviceName);

        String packageName = "";
        if (clazz.getPackage() != null) {
            packageName = clazz.getPackage().getName();
        }
        model.setPackageName(packageName);

        String targetNamespace = URIParserUtil.getNamespace(packageName);
        if (env.optionSet(ToolConstants.CFG_TNS)) {
            targetNamespace = (String)env.get(ToolConstants.CFG_TNS);
        } else if (webService.targetNamespace().length() > 0) {
            targetNamespace = webService.targetNamespace();
        } else if (targetNamespace == null) {
            Message message = new Message("SEI_CLASS_HASNO_PACKAGE", LOG);
            throw new ToolException(message);
        }

        model.setTargetNameSpace(targetNamespace);
        String wsdlLocation = webService.wsdlLocation();
        model.setWsdllocation(wsdlLocation);
View Full Code Here

                        return false;
                    }
                    return ((Integer)result).intValue() == 0;
                } catch (Exception e1) {
                    Message msg = new Message("FAIL_TO_COMPILE_GENERATE_CODES", LOG);
                    throw new ToolException(msg, e1);
                }
            } catch (NoSuchMethodException e2) {
                throw new ToolException(e2.getMessage(), e2);
            }
        } catch (ClassNotFoundException e3) {
            throw new ToolException(e3.getMessage(), e3);
           
        } catch (SecurityException e4) {
            throw new ToolException(e4.getMessage() , e4);
        }
    }
View Full Code Here

    public void process() throws ToolException {
        init();
        if (isBindingExisted()) {
            Message msg = new Message("BINDING_ALREADY_EXIST", LOG);
            throw new ToolException(msg);
        }
        if (!isPortTypeExisted()) {
            Message msg = new Message("PORTTYPE_NOT_EXIST", LOG);
            throw new ToolException(msg);
        }
        if (isServicePortExisted()) {
            Message msg = new Message("SERVICE_PORT_EXIST", LOG);
            throw new ToolException(msg);
        }
        extReg = this.wsdlReader.getExtensionRegistry();
        doAppendBinding();
        doAppendService();
        writeToWSDL();
View Full Code Here

        try {
            xmlBinding = (XMLFormatBinding)extReg.createExtension(Binding.class,
                                                                  ToolConstants.XML_BINDING_FORMAT);
        } catch (WSDLException wse) {
            Message msg = new Message("FAIL_TO_CREATE_XMLBINDING", LOG);
            throw new ToolException(msg);
        }
        binding.addExtensibilityElement(xmlBinding);
    }
View Full Code Here

        XMLFormat xmlFormat = null;
        try {
            xmlFormat = (XMLFormat)extReg.createExtension(clz, ToolConstants.XML_FORMAT);
        } catch (WSDLException wse) {
            Message msg = new Message("FAIL_TO_CREATE_XMLBINDING", LOG);
            throw new ToolException(msg);
        }
        xmlFormat.setRootNode(new QName(wsdlDefinition.getTargetNamespace(), operationName));
        return xmlFormat;
    }
View Full Code Here

        try {
            xmlHttpAddress = (XMLHttpAddress)extReg.createExtension(Port.class,
                                                                    WSDLConstants.NS_XMLHTTP_BINDING_ADDRESS);
        } catch (WSDLException wse) {
            Message msg = new Message("FAIl_TO_CREATE_SOAPADDRESS", LOG);
            throw new ToolException(msg);
        }
        if (env.get(ToolConstants.CFG_ADDRESS) != null) {
            xmlHttpAddress.setLocation((String)env.get(ToolConstants.CFG_ADDRESS));
        } else {
            xmlHttpAddress.setLocation(HTTP_PREFIX + "/" + env.get(ToolConstants.CFG_SERVICE) + "/"
View Full Code Here

        Writer outputWriter = getOutputWriter(NEW_FILE_NAME_MODIFIER);
        try {
            wsdlWriter.writeWSDL(wsdlDefinition, outputWriter);
        } catch (WSDLException wse) {
            Message msg = new Message("FAIL_TO_WRITE_WSDL", LOG);
            throw new ToolException(msg);
        }
        try {
            outputWriter.close();
        } catch (IOException ioe) {
            Message msg = new Message("FAIL_TO_CLOSE_WSDL_FILE", LOG);
            throw new ToolException(msg);
        }
    }
View Full Code Here

    public void process() throws ToolException {
        validateWSDL();
        init();
        if (isSOAP12Binding(wsdlDefinition)) {
            Message msg = new Message("SOAP12_UNSUPPORTED", LOG);
            throw new ToolException(msg);
        }
        generateTypes();
        JavaModel jmodel = wsdlDefinitionToJavaModel(getWSDLDefinition());
        if (jmodel == null) {
            Message msg = new Message("FAIL_TO_CREATE_JAVA_MODEL", LOG);
            throw new ToolException(msg);
        }
        registerGenerators(jmodel);
        doGeneration();
        if (env.get(ToolConstants.CFG_COMPILE) != null) {
            compile();
View Full Code Here

            } else {
                return;
            }
        } catch (IOException e) {
            Message msg = new Message("FAIL_TO_GENERATE_TYPES", LOG);
            throw new ToolException(msg);

        }
    }
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.tools.common.ToolException

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.