/// <summary> /// Returns the capabilities of the ServiceBrowser as currently implemented. /// Universal Remoting enabled projects may choose to implement all or some of the capabilities of the front-end. /// </summary> /// <returns> /// An array of objects. Each object should be in the format {name:String, version:Number, data:*}. /// </returns> public ASObject getCapabilities() { string version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); ASObject result = new ASObject(); // authentication: This Remoting implementation supports AMF0/AMF3 authentication ASObject asoAuthentication = new ASObject(); asoAuthentication["name"] = "authentication"; asoAuthentication["version"] = "FormsAuthentication"; asoAuthentication["data"] = "true"; result["authentication"] = asoAuthentication; // secure: The user of the service browser must authenticate him/herself with // the unlock method before accessing it. // The roles of all the methods except verifyLogin and getCapabilities should be set // to admin. //ASObject secure = new ASObject(); // codegen: This service browser supports code generation ASObject asoCodegen = new ASObject(); asoCodegen["name"] = "codegen"; asoCodegen["version"] = version; asoCodegen["data"] = CodeGeneratorService.GetCodeTemplates(); //.ToArray(typeof(object)) as object[]; result["codegen"] = asoCodegen; result["version"] = version; // codesave: This service browser supports code saving. // data in this case may contain the enabled key. // If enabled is set to false, indicates that the remote class has the remote code // saving capability, but it is disabled because of a lack of permissions in the target directory. // if data is null, assume enabled is true. //ASObject codesave = new ASObject(); return(result); }
public void SaveCode(HttpApplication httpApplication) { CodeGeneratorService codeGeneratorService = new CodeGeneratorService(); codeGeneratorService.SaveCode(httpApplication); }
public ASObject previewCode(string codeTemplate, string serviceName, string methodName) { return(CodeGeneratorService.GetCodePreview(codeTemplate, serviceName, methodName)); }