Package org.objectweb.celtix.tools.common

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


        SOAPFault soapFault = null;
        try {
            soapFault = (SOAPFault)extReg.createExtension(BindingFault.class, WSDLConstants.NS_SOAP_FAULT);
        } catch (WSDLException wse) {
            Message msg = new Message("FAIL_TO_CREATE_SOAPBINDING", LOG);
            throw new ToolException(msg, wse);
        }
        soapFault.setName(bf.getName());
        soapFault.setUse((String)env.get(ToolConstants.CFG_USE));
        if (WSDLConstants.RPC.equalsIgnoreCase((String)env.get(ToolConstants.CFG_STYLE))
            && env.optionSet(ToolConstants.CFG_NAMESPACE)) {
View Full Code Here


    public void process() throws ToolException {
        init();
        if (isServicePortExisted()) {
            Message msg = new Message("SERVICE_PORT_EXIST", LOG);
            throw new ToolException(msg);
        }
        if (!isBindingExisted()) {
            Message msg = new Message("BINDING_NOT_EXIST", LOG);
            throw new ToolException(msg);
        }
        doAppendService();
    }
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, wse);
        }
        try {
            outputWriter.close();
        } catch (IOException ioe) {
            Message msg = new Message("FAIL_TO_CLOSE_WSDL_FILE", LOG);
            throw new ToolException(msg, ioe);
        }

    }
View Full Code Here

            try {
                soapAddress = (SOAPAddress)extReg.createExtension(Port.class,
                                                                  WSDLConstants.NS_SOAP_BINDING_ADDRESS);
            } catch (WSDLException wse) {
                Message msg = new Message("FAIl_TO_CREATE_SOAPADDRESS", LOG);
                throw new ToolException(msg, wse);
            }
            if (env.get(ToolConstants.CFG_ADDRESS) != null) {
                soapAddress.setLocationURI((String)env.get(ToolConstants.CFG_ADDRESS));
            } else {
                soapAddress.setLocationURI(HTTP_PREFIX + "/" + env.get(ToolConstants.CFG_SERVICE) + "/"
                                           + env.get(ToolConstants.CFG_PORT));
            }
            port.addExtensibilityElement(soapAddress);
        } else if ("jms".equalsIgnoreCase((String)env.get(ToolConstants.CFG_TRANSPORT))) {
            JMSAddress jmsAddress = null;
            JMSAddressSerializer jmsAddressSerializer = new JMSAddressSerializer();
            try {
                extReg.registerSerializer(JMSAddress.class, ToolConstants.JMS_ADDRESS, jmsAddressSerializer);
                extReg
                    .registerDeserializer(JMSAddress.class, ToolConstants.JMS_ADDRESS, jmsAddressSerializer);
                jmsAddress = (JMSAddress)extReg.createExtension(Port.class, ToolConstants.JMS_ADDRESS);
                if (env.optionSet(ToolConstants.JMS_ADDR_DEST_STYLE)) {
                    jmsAddress.setDestinationStyle((String)env.get(ToolConstants.JMS_ADDR_DEST_STYLE));
                }
                if (env.optionSet(ToolConstants.JMS_ADDR_INIT_CTX)) {
                    jmsAddress.setInitialContextFactory((String)env.get(ToolConstants.JMS_ADDR_INIT_CTX));
                }
                if (env.optionSet(ToolConstants.JMS_ADDR_JNDI_DEST)) {
                    jmsAddress.setJndiDestinationName((String)env.get(ToolConstants.JMS_ADDR_JNDI_DEST));
                }
                if (env.optionSet(ToolConstants.JMS_ADDR_JNDI_FAC)) {
                    jmsAddress.setJndiConnectionFactoryName((String)env.get(ToolConstants.JMS_ADDR_JNDI_FAC));
                }
                if (env.optionSet(ToolConstants.JMS_ADDR_JNDI_URL)) {
                    jmsAddress.setJndiProviderURL((String)env.get(ToolConstants.JMS_ADDR_JNDI_URL));
                }
                if (env.optionSet(ToolConstants.JMS_ADDR_MSGID_TO_CORRID)) {
                    jmsAddress.setUseMessageIDAsCorrelationID(Boolean.getBoolean((String)env
                        .get(ToolConstants.JMS_ADDR_MSGID_TO_CORRID)));
                }
                if (env.optionSet(ToolConstants.JMS_ADDR_SUBSCRIBER_NAME)) {
                    jmsAddress.setDurableSubscriberName((String)env
                        .get(ToolConstants.JMS_ADDR_SUBSCRIBER_NAME));
                }
            } catch (WSDLException wse) {
                Message msg = new Message("FAIL_TO_CREATE_SOAP_ADDRESS", LOG);
                throw new ToolException(msg, wse);
            }
            port.addExtensibilityElement(jmsAddress);
        }
    }
View Full Code Here

        try {
            model = new WSDLModel();
        } catch (Exception e) {
            Message msg = new Message("FAIL_TO_BUILD_WSDLMODEL", LOG);
            LOG.log(Level.SEVERE, msg.toString());
            throw new ToolException(msg);
        }

        init();
        buildModel(model, getSEIClass());
        final WSDLGenerator generator = new WSDLGenerator(model, penv);
View Full Code Here

            JavaParameter paramInList = getParameter(param.getName());
            if (paramInList.isIN() || paramInList.isINOUT()) {
                removeParameter(paramInList);
            } else {
                Message message = new Message("PARAMETER_ALREADY_EXIST", LOG, param.getName());
                throw new ToolException(message);
            }
        }
        parameters.add(param);
    }
View Full Code Here

    }

    public void addException(JavaException exception) {
        if (hasException(exception)) {
            Message message = new Message("EXCEPTION_ALREADY_EXIST", LOG, exception.getName());
            throw new ToolException(message);
        }
        exceptions.add(exception);
    }
View Full Code Here

    public void addWSDLException(WSDLException exception) {
        if (wsdlExceptions.contains(exception)) {
            Message message = new Message("EXCEPTION_ALREADY_EXIST", LOG,
                                          exception.getDetailType().getName());
            throw new ToolException(message);
        }
        wsdlExceptions.add(exception);
    }
View Full Code Here

        try {
            reqClass = AnnotationUtil.loadClass(reqClassName, method.getDeclaringClass().getClassLoader());
        } catch (Exception e) {

            Message msg = new Message("LOAD_CLASS_ERROR", LOG, reqClassName);
            throw new ToolException(msg, e);
        }
        QName reqQN = new QName(reqNS, reqName);
        TypeReference typeRef = new TypeReference(reqQN, reqClass, new Annotation[0]);
        WSDLParameter request = new WSDLParameter(reqName, typeRef, JavaType.Style.IN);
        request.setTargetNamespace(reqNS);
        javaMethod.addRequest(request);

        WSDLParameter response = null;
        if (!isOneWayMethod(method)) {
            // process response
            ResponseWrapper resWrapper = method.getAnnotation(ResponseWrapper.class);
            String resClassName = "";
            // rule 3.5 suffix -"Response"
            String resName = method.getName() + "Response";
            String resNS = model.getTargetNameSpace();
            if (resWrapper != null) {
                resClassName = resWrapper.className();
                resName = resWrapper.localName().length() > 0 ? resWrapper.localName() : resName;
                resNS = resWrapper.targetNamespace().length() > 0 ? resWrapper.targetNamespace() : resNS;
            } else {
                resClassName = model.getPackageName() + ".types."
                    + AnnotationUtil.capitalize(method.getName())
                               + "Response";
            }
            Class resClass = null;
            QName resQN = new QName(resNS, resName);
            try {
                resClass = AnnotationUtil
                    .loadClass(resClassName, method.getDeclaringClass().getClassLoader());
            } catch (Exception e) {
                Message msg = new Message("LOAD_CLASS_ERROR", LOG, resClassName);
                throw new ToolException(msg, e);
            }
            typeRef = new TypeReference(resQN, resClass, new Annotation[0]);
            response = new WSDLParameter(resName, typeRef, JavaType.Style.OUT);
            response.setTargetNamespace(resNS);
            javaMethod.addResponse(response);
View Full Code Here

            Class exReturnType = null;
            Method faultInfo = null;
            try {
                faultInfo = exClass.getMethod("getFaultInfo", new Class[0]);
            } catch (SecurityException e) {
                throw new ToolException(e.getMessage(), e);
            } catch (NoSuchMethodException e) {
                throw new ToolException(e.getMessage(), e);
            }

            if (faultInfo != null) {
                WebFault wf = exClass.getAnnotation(WebFault.class);
                exReturnType = faultInfo.getReturnType();
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.