@Override
    public String generateWADL(String wsdlPath)
    {
        String fileName = "";
        try
        {

            wadl wadlFile = new wadl();
            setMethodInfo(wadlFile, wsdlPath);
            setIOparams(wadlFile, wsdlPath);

            String wadl = wadlFile.header;
            wadl += "    <resources base='WADLForGalaxyTools/'> \n"
                    + "    <resource path='galaxyTool" + wadlFile.getmethodId() + "'>\n";

            List<parameter> ipParams = wadlFile.getInputs();
            List<parameter> opParams = wadlFile.getOutputs();

            String request = "\t\t<request>\n";
            for (parameter pp : ipParams)
            {
                request += "\t\t\t<param name='" + pp.p_name + "' "
                        + "type='" + pp.p_type + "' "
                        + "required='" + pp.p_required + "' ";
                if (!pp.p_value.equals(""))
                {
                    request += "default='" + pp.p_value + "' ";
                }
                request += ">";
                if (!pp.paramDoc.equals(""))
                {
                    request += "\n\t\t\t\t<doc title='description'>" + pp.paramDoc + "</doc>\n";
                }
                if (!pp.optValues.isEmpty())
                {
                    for (String option : pp.optValues)
                    {
                        request += "\t\t\t\t<option value='" + option + "' />\n";
                    }
                }
                request += "\t\t\t</param>\n";
            }

            request += "\t\t</request>\n";

            String response = "\t\t<response>\n";
            for (parameter op : opParams)
            {
                response += "\t\t\t<param name='" + op.p_name + "' type='" + op.p_type + "' > \n";
                if (!op.paramDoc.equals(""))
                {
                    response += "\t\t\t\t<doc title='description'>" + op.paramDoc + "</doc>\n";
                }
                response += "\t\t\t</param>\n";
            }
            response += "\t\t</response>\n";

            String method = "\t<method name='" + wadlFile.getmethodName() + "' id='" + wadlFile.getmethodId() + "'> \n"
                          + "\t\t<doc title='description'>" + wadlFile.getDescription() + "</doc>\n";
            method += request;
            method += response;
            method += "\t</method>\n";
            wadl += method;
            wadl += "    </resource>\n"
                    + "    </resources>\n</application>";
            System.out.println(wadl);

            fileName = wsdlPath.replace(".xml", "WADL.wadl");
            FileWriter file;
            file = new FileWriter(fileName);
            BufferedWriter br = new BufferedWriter(file);
            br.write(wadl);
            br.close();
            file.close();

        } catch (java.io.IOException ex)
        {
            fileName = "WADL File could not be created due to exception" + ex.getMessage();
        } 
        catch (Exception e)
        {
            fileName = "Unexpected error occured" + e;
        }
        finally
        {
            return fileName;
        }
    }