public class WADLGenerator {
public static String generateWADLForMashupRESTService(String myCocktailPath, int mashupId) throws DAOException, IOException {
Mashup mashup = getMashup(mashupId);
ApplicationDocument applicationDocument = ApplicationDocument.Factory.newInstance();
Application application = applicationDocument.addNewApplication();
Resources resources = application.addNewResources();
resources.setBase(myCocktailPath);
Resource resource = resources.addNewResource();
resource.setPath("RESTService/mashupId="+mashupId);
addResource(resource, "json", "format=json", mashup, "application/json");
addResource(resource, "xml", "format=xml", mashup, "application/xml");
addResource(resource, "jsonp", "format=jsonp", mashup, "application/javascript");
return applicationDocument.xmlText(new XmlOptions().setSavePrettyPrint());
}