Words on my addictions: .NET, Philosophy, Music

12 May 2006

[AlephFS] New WSE Project

Filed under: C# — stefanprodan @ 3:04 pm

I’ve stated a new research project based on Web Services Enhancements Version 3.0. The goal is to port the FTP standard 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. Code upgrade concerning Dime to MTOM is easy, example follows:

//DIME 
[WebMethod] 
public void GetFile(string fileName) 
{ 
   SoapContext repcntxt = ResponseSoapContext.Current; 

DimeAttachment dimeattch = 
 new DimeAttachment("binary", 
 TypeFormat.Unknown, 
 HttpContext.Current.Server.MapPath(fileName)); 

repcntxt.Attachments.Add(dimeattch); 
} 

//MTOM 
[WebMethod] 
public byte[] GetFile(string fileName) 
{ 
    byte[] response = File.ReadAllBytes(fileName); 
    return response; 
}

I will post more stuff on MTOM and FTP over SOAP as the project will go on. Wish me luck.

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: