function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jchanowitzjchanowitz 

"Unexpected Error" when trying to compile Apex Class

I have hierarchical type data in SalesForce that I'm trying to bring over to a client via  an Apex web service.  As an example I have a directory tree structure consisting of "folders" and "files", where folders can contain files and other folders.  The classes I'm trying to build are
 
Code:
global class Folder {
    webservice ID id;
    webservice String title;
    webservice File[] files;
    webservice Folder[] subFolders;
}

global class File {
    webservice ID id;
    webservice String title;
}

My objective is to return the top level folder, which would have within it the entire tree structure of what I'm trying to render in my client.  When I try to compile, I get:
 
Unable to perform compile/save/delete: SoapFaultException: UNKNOWN_EXCEPTION: An unexpected error occured. Please include this ErrorId if you contact support: 76227213-49
It seems the subFolders member is causing the error.  If I remove either the array or the webservice keyword, things compile just fine.  Is there any way to do this?
 
Thanks