public override void BeforeMarshall(OpenWireFormat wireFormat)
{
if(body == null)
{
Content = null;
}
else
{
MemoryStream buffer = new MemoryStream();
Stream target = buffer;
if(this.Connection != null && this.Connection.UseCompression)
{
target = this.Connection.CompressionPolicy.CreateCompressionStream(target);
this.Compressed = true;
}
this.body.Marshal(target);
target.Close();
this.Content = buffer.ToArray();
}
Tracer.Debug("BeforeMarshalling, content is: " + Content);
base.BeforeMarshall(wireFormat);
}