by david
2. August 2010 09:20
Here is some example code for the simple MessageDecoder class that I wrote for my last blog, it takes an example ebMS 3.0 soap document from a file and loads it - giving access to the UserMessage and SignalMessage elements inside the envelope header. I have tried it on all the examples that I extracted from the eMS 3.0 core spec and it seems to work OK. It's just a start...
using System;
using System.IO;
using ebMS3.Soap;
namespace SoapLoaderTest
{
class Program
{
static void Main(string[] args)
{
string filename = "example.xml";
FileStream file = new FileStream(filename, FileMode.Open,
FileAccess.Read);
ebMS3.Soap.MessageDecoder decoder = new MessageDecoder(file);
SignalMessage[] smsgs = decoder.GetHeaderSignalMessages();
UserMessage[] umsgs = decoder.GetHeaderUserMessages();
file.Close();
}
}
}