public static void CreateClasess(String packagename) throws Exception
    {
        //split classes into Unknowns and Complextypes

        //create complex types
        InputStream file = ClassProcessor.class.getResourceAsStream("SoapComplexTypeClassTemplate.txt");


        if (file != null)
        {
            String blankText = FileHelper.getContents(file);
            file.close();
            
            //loop through class and sort into types
            for (SoapClass spClass : PropertyContainer.ComplexTypes)
            {

                if (spClass.isArray == true)
                {
                    InputStream litFile = ClassProcessor.class.getResourceAsStream("ArrayObjectTemplate.txt");


                    if (litFile != null) {
                        String classText = FileHelper.getContents(litFile);

                        litFile.close();

                        //replace package place holder
                        classText = classText.replaceAll("%%PACKAGENAME%%", packagename);

                        //now find classname and replace that with the class name
                        classText = classText.replaceAll("%%CLASSNAME%%", spClass.Name);

                        //now find element type placeholder and replace that with the element type
                        classText = classText.replaceAll("%%ELEMENTTYPE%%", spClass.ElementType);

                        //now save to folder
                        String filePath = FileHelper.GetOutputFolderPath() + "/" + spClass.Name + ".java";
                        FileHelper.WriteClassTextToFile(filePath, classText);
                    }
                    else
                    {
                     throw new Exception("could not locate Array Object Template");
                    }
                }
                else
                {
                    String classText = blankText;

                    //replace package place holder
                    classText = classText.replaceAll("%%PACKAGENAME%%", packagename);

                    //now find classname and replace that with the class name
                    classText = classText.replaceAll("%%CLASSNAME%%", spClass.Name);

                     //set superclas
                    //classText = classText.replaceAll("%%SUPERCLASS%%",spClass.SuperClassType);

                    //build properties insert
                    String propText = "";
                    String getPropText = "";
                    String getPropInfoText = "";
                    String setPropText = "";
                    String regTypes = "";
                    int caseCount = 0;


                    //need to build up properties from base class if not soapobject
                    List<SoapClassProperty> propertyArray =  new ArrayList<SoapClassProperty>();


                    if (!spClass.SuperClassType.equals("BaseObject"))
                    {
                         //if base object is not default load properties from superclass first then

                        //find the super class
                        SoapClass superClass = PropertyContainer.GetClassWithName(spClass.SuperClassType);

                        if (superClass != null)
                        {
                            propertyArray.addAll(superClass.Properties);
                        }
                    }
                    
                    //now load the properties from this class
                    propertyArray.addAll(spClass.Properties);

                    //set property count
                    classText = classText.replaceAll("%%PROPCOUNT%%", String.format("%d", propertyArray.size()));

                    for (SoapClassProperty prop : propertyArray)
                    {

                        if (!prop.getIsArray())
                        {
                            propText += String.format("     public %s %s;", prop.getPropertyClassType(),prop.getPropertyName()) + "\n";
                        }
                        else
                        {
                             propText += String.format("     //array \n");
                             propText += String.format("     public %s %s;", prop.getPropertyClassType(),prop.getPropertyName()) + "\n";
                        }

                        //prop case text
                        getPropText += String.format("           case %d: \n", caseCount);
                        getPropText += String.format("                return %s; \n",prop.getPropertyName());

                        //prop info text
                        getPropInfoText += String.format("           case %d: \n", caseCount);
                        getPropInfoText += String.format("                info.name = \"%s\"; \n",prop.getPropertyName());
                        getPropInfoText += String.format("                info.type = %s; \n",getClassTypeRetrievalString(prop.getPropertyName(),prop.getPropertyClassType()));
                        getPropInfoText += String.format("                             break; \n","");

                        //set prop text
                        setPropText += String.format("           case %d: \n", caseCount);
                        setPropText += String.format("                %s = %s; \n",prop.getPropertyName(),getConvertorForType(prop.getPropertyClassType()));
                        setPropText += String.format("                  break; \n","");



                        if (prop.getIsComplexType())
                        {

                            //get the class for this complex type and then check to see if its an

                            regTypes +=  String.format("           new %s().register(envelope); \n",prop.getPropertyClassType());
                        }

                        caseCount++;

                    }

                    //set property count
                    classText = classText.replaceAll("%%PROPERTIES%%", propText);



                    //set getProperty text
                    classText = classText.replaceAll("%%GETPROPERTY%%", getPropText);

                    //set getProperty text
                    classText = classText.replaceAll("%%GETPROPINFO%%", getPropInfoText);

                    //set setProperty text
                    classText = classText.replaceAll("%%SETPROP%%", setPropText);

                    //set setProperty text
                    classText = classText.replaceAll("%%REGISTERTYPES%%", regTypes);

                    //write to file
                    String filePath = FileHelper.GetOutputFolderPath() + "/" + spClass.Name + ".java";
                    FileHelper.WriteClassTextToFile(filePath, classText);

                }
            }
        }

    }