Hello, I had the same issue with reading DWG files using custom SOE and managed to solve it. It turned out that the OpenFromFile() method must be called with directory path not the file path as argument.
So instead of:
IWorkspace workspace = factory.OpenFromFile(fileName, 0);
Try with this:
string directoryName = fileName.Substring(0, fileName.LastIndexOf('\\'));
IWorkspace workspace = factory.OpenFromFile(directoryName, 0);