Published Tuesday, May 30, 2006 4:43 PM by Aleph

[AlephFS] Research Project

Project Name: AlephFS
Start Date: 08 May 2006
Technologies used: ASP.NET 2.0 & WSE 3.0 & MTOM

I've stated a new research project based on Web Services Enhancements Version 3.0. The goal is to make a FTP server like application but on Soap. I have tried this before on the Net Framework 1.1 using DIME Attachments.
The problem was that Dime could not be used with WS-* because the binary content of the message was sent outside the SoapEnvelope of the XML message. Even if the message is secure the binary attachment is not.WSE 3.0 comes with MTOM (Message Transmission Optimization Mechanism), MTOM fully complies with WS-Security so the entire message is secure.
As long as the project will go on I will post here code that maybe you'll find useful.
The web service is based on the IFileServer interface but this is just the start point.

/// <summary>
/// File Server Interface
/// </summary>
public interface IFileServer
{
    //
    //CUSTOM SECURITY
    //

    /// <summary>
    /// Create a new directory
    /// </summary>
    /// <param name="dirName">Folder name</param>
    void CreateDir(string dirName);
    /// <summary>
    /// Returns the folders within the directory(first level not recursive)
    /// </summary>
    /// <param name="dirName"></param>
    /// <returns></returns>
    StringCollection ListDirs(string dirName);
    /// <summary>
    /// Delete an existing directory and all the content inside it
    /// </summary>
    /// <param name="dirName">Folder name</param>
    void DeleteDir(string dirName);
    /// <summary>
    /// Returns the files within the directory(first level not recursive)
    /// </summary>
    /// <param name="dirName">Folder name</param>
    /// <returns>files list</returns>
    StringCollection ListFiles(string dirName);
    /// <summary>
    /// Returns the files within the directory(recursive)
    /// </summary>
    /// <param name="dirName"></param>
    /// <returns>files list</returns>
    StringCollection ListFilesRecursive(string dirName);
    /// <summary>
    /// Uploads file to specific directory
    /// </summary>
    /// <param name="path">destination folder</param>
    /// <param name="fileName"> file name</param>
    void UploadFile(string path, string fileName, byte[] data);
    /// <summary>
    /// Downloads file from server
    /// </summary>
    /// <param name="path">server relative path to file</param>
    /// <returns>binary data</returns>
    byte[] DownloadFile(string path);
    /// <summary>
    /// Deletes a specific file from the server
    /// </summary>
    /// <param name="path">server relative path to file</param>
    void DeleteFile(string path);

    //
    //WINDOWS IMPERSONATION
    //

    /// <summary>
    /// Create a new directory
    /// </summary>
    /// <param name="dirName">Folder name</param>
    void CreateDirImp(string user, string domain, string password, string dirName);
    /// <summary>
    /// Returns the folders within the directory(first level not recursive)
    /// </summary>
    /// <param name="dirName"></param>
    /// <returns></returns>
    StringCollection ListDirsImp(string user, string domain, string password, string dirName);
    /// <summary>
    /// Delete an existing directory and all the content inside it
    /// </summary>
    /// <param name="dirName">Folder name</param>
    void DeleteDirImp(string user, string domain, string password, string dirName);
    /// <summary>
    /// Returns the files within the directory(first level not recursive)
    /// </summary>
    /// <param name="dirName">Folder name</param>
    /// <returns>files list</returns>
    StringCollection ListFilesImp(string user, string domain, string password, string dirName);
    /// <summary>
    /// Returns the files within the directory(recursive)
    /// </summary>
    /// <param name="dirName"></param>
    /// <returns>files list</returns>
    StringCollection ListFilesRecursiveImp(string user, string domain, string password, string dirName);
    /// <summary>
    /// Uploads file to specific directory
    /// </summary>
    /// <param name="path">destination folder</param>
    /// <param name="fileName"> file name</param>
    void UploadFileImp(string user, string domain, string password, string path, string fileName, byte[] data);
    /// <summary>
    /// Downloads file from server
    /// </summary>
    /// <param name="path">server relative path to file</param>
    /// <returns>binary data</returns>
    byte[] DownloadFileImp(string user, string domain, string password, string path);
    /// <summary>
    /// Deletes a specific file from the server
    /// </summary>
    /// <param name="path">server relative path to file</param>
    void DeleteFileImp(string user, string domain, string password, string path);
}



Filed under

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

.NET Diary : AlephFS Project said:

May 31, 2006 4:11 AM
 

.NET Diary said:

Using SoapHeader for authentication
May 31, 2006 6:17 AM

Leave a Comment

Name  

Comments 
Type the characters you see in the picture on the left.
    



Note: HTML tags in comment messages are not supported.


About Aleph

VB.NET programmer '02
C# programmer '03
Software Analyst '05
Software Architect '06