Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Architecture> WebServices: XML or Binary formatting?
 

Pages: 1
Architecture
WebServices: XML or Binary formatting?
Page:1/1 

  Print all messages in this thread  
Poster Message
obzekt
User



Location:

Joined on:
29-Apr-2004 18:18:59
Posted:
49 posts
# Posted on: 09-Jun-2004 18:22:42.  
Hello. I'm prototyping an app and have the dilemma on which format to use for returning serialized entities and collections from my WebMethods:

1. MemoryStream stream = new MemoryStream();
BinaryFormatter fmt = new BinaryFormatter();
fmt.Serialize(stream, obj);
string s = System.Convert.ToBase64String(stream.GetBuffer());

2. string s = String.Empty;
if (obj is IEntity2) ((IEntity2)obj).WriteXml(out s);
else if (obj is IEntityCollection2) ((IEntityCollection2)obj).WriteXml(out s);

Surprisingly, the binary output seems to be 10-15% larger, but I'm not sure what is faster. What is the forum's experience with a production system?

Otis, what is your suggestion?
  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37870 posts
# Posted on: 09-Jun-2004 19:08:19.  
Return an XmlNode, you fill with WriteXml. You can at the client build back the object by passing the XmlNode to the ReadXml() method. Regular Smiley

Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.