Package org.apache.axis2.wsdl.codegen

Examples of org.apache.axis2.wsdl.codegen.CodeGenerationException


                        targetnamespaceFound = true;
                        break;
                    }
                }
                if (!targetnamespaceFound)
                    throw new CodeGenerationException(
                            "Invalid WSDL: The WSDL Types Schema does not define a targetNamespace in "+schema.getName() );
            }

        }
    }
View Full Code Here


        //first get the language specific property map
        Class clazz = this.getClass();
        Map languageSpecificPropertyMap = (Map)ConfigPropertyFileLoader.getLanguageSpecificPropertiesMap().get(this.language);
        if (languageSpecificPropertyMap==null){
            throw new CodeGenerationException("No language specific properties!!!");
        }

        String templateName = findTemplate(languageSpecificPropertyMap);
        if (templateName!=null){
            this.xsltStream = clazz.getResourceAsStream(templateName);
        }else{
            throw new CodeGenerationException("template for this writer is not found");
        }


    }
View Full Code Here

            // Do we need to enforce this here ?????
            // Perhaps we can introduce a flag to determine this!
            emitStub();

        } catch (Exception e) {
            throw new CodeGenerationException(e);
        }
    }
View Full Code Here

            }else{
                throw new Exception("Unknown code generation style!!! " + codegenStyle);
            }

        } catch (Exception e) {
            throw new CodeGenerationException(e);
        }
    }
View Full Code Here

            // A check to avoid nasty surprises - Since unwrapping is not
            // supported by all frameworks, we check the framework name to be
            // compatible
            if (!ConfigPropertyFileLoader.getUnwrapSupportedFrameworkNames().
                    contains(configuration.getDatabindingType())) {
                throw new CodeGenerationException(
                        CodegenMessages.getMessage("extension.unsupportedforunwrapping"));
            } else if (!ConfigPropertyFileLoader.getUnwrapDirectFrameworkNames().
                    contains(configuration.getDatabindingType())) {

                //walk the schema and find the top level elements
View Full Code Here

            QName opName = message.getAxisOperation().getName();
            partNameList.add(WSDLUtil.getPartQName(opName.getLocalPart(),
                    qnameSuffix,
                    schemaElement.getQName().getLocalPart()));
        } else if (schemaType == null) {
            throw new CodeGenerationException("Can not determine the schema type for the "
                    + schemaElement.getName());
        } else {
            //we've no idea how to unwrap a non complexType!!!!!!
            throw new CodeGenerationException(
                    CodegenMessages.getMessage("extension.unsupportedSchemaFormat",
                            schemaType.getName(), "complexType"));
        }


        try {
            //set in the axis message that the unwrapping was success
            message.addParameter(getParameter(
                    Constants.UNWRAPPED_KEY,
                    Boolean.TRUE));

            // attach the opName and the parts name list into the
            // axis message by using the holder
            MessagePartInformationHolder infoHolder = new MessagePartInformationHolder();
            infoHolder.setOperationName(message.getAxisOperation().getName());
            infoHolder.setPartsList(partNameList);

            //attach it to the parameters
            message.addParameter(
                    getParameter(Constants.UNWRAPPED_DETAILS,
                            infoHolder));

        } catch (AxisFault axisFault) {
            throw new CodeGenerationException(axisFault);
        }

    }
View Full Code Here

                    partNameList.add(
                            WSDLUtil.getPartQName(opName.getLocalPart(),
                                    qnameSuffix,
                                    Constants.ANY_ELEMENT_FIELD_NAME));
                } else {
                    throw new CodeGenerationException(
                            CodegenMessages.getMessage("extension.unsupportedSchemaFormat",
                                    "unknown type", "Element"));
                }
            }

            //we do not know how to deal with other particles
            //such as xs:all or xs:choice. Usually occurs when
            //passed with the user built WSDL where the style
            //is document.
        } else if (schemaParticle instanceof XmlSchemaChoice) {
            throw new CodeGenerationException(
                    CodegenMessages.getMessage("extension.unsupportedSchemaFormat",
                            "choice", "sequence"));

        } else if (schemaParticle instanceof XmlSchemaAll) {
            throw new CodeGenerationException(
                    CodegenMessages.getMessage("extension.unsupportedSchemaFormat",
                            "all", "sequence"));
        } else {
            throw new CodeGenerationException(
                    CodegenMessages.getMessage("extension.unsupportedSchemaFormat",
                            "unknown", "sequence"));
        }
    }
View Full Code Here

        //first get the language specific property map
        Class clazz = this.getClass();
        Map languageSpecificPropertyMap =
                (Map)ConfigPropertyFileLoader.getLanguageSpecificPropertiesMap().get(this.language);
        if (languageSpecificPropertyMap == null) {
            throw new CodeGenerationException(
                    CodegenMessages.getMessage("writer.noLangPropertiesExtension"));
        }

        String templateName = findTemplate(languageSpecificPropertyMap);
        if (templateName != null) {
            this.xsltStream = clazz.getResourceAsStream(templateName);
        } else {
            throw new CodeGenerationException(CodegenMessages.getMessage("writer.templateMissing"));
        }


    }
View Full Code Here

            //mix databinding types!

            String databindingName = rootMappingsElement.
                    getAttribute(DB_FRAMEWORK_ATTRIBUTE_NAME);
            if (!databindingName.equals(configuration.getDatabindingType())) {
                throw new CodeGenerationException(
                        CodegenMessages.
                                getMessage("extension.databindingMismatch")
                );
            }
            configuration.
View Full Code Here

            documentBuilderFactory.setNamespaceAware(true);
            DocumentBuilder documentBuilder =
                    documentBuilderFactory.newDocumentBuilder();
            return documentBuilder.parse(configuration.getTypeMappingFile());
        } catch (Exception e) {
            throw new CodeGenerationException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.axis2.wsdl.codegen.CodeGenerationException

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.