V
Vai2000
I am using DIME currently was planning to upgrade to MTOM. After following
the simple example from their SDK things don't seem to work! I did all the
WSE settings through the wizard.
Client CodeWSEHost.Service serviceproxy = new WSEHost.Service();
// Specify that MTOM encoding must be used.
serviceproxy.UseDefaultCredentials = true;
// Communicate with the Web service to get the requested file.
byte[] response = serviceproxy.GetFile("foo.txt");
MemoryStream memory = new MemoryStream(response);
// Display the file in a picture box.
//pictureBox1.Image = System.Drawing.Image.FromStream(memory);
using (StreamWriter sw = new StreamWriter(@"C:\vtemp\FooSvc.txt"))
{
using (StreamReader sr = new StreamReader(memory))
{
sw.Write(sr.ReadToEnd());
}
}
Server Codepublic byte[] GetFile(string fileName){
byte[] response;
String filePath = AppDomain.CurrentDomain.BaseDirectory + @"App_Data\" +
fileName;
response = File.ReadAllBytes(filePath);
return response;
}
the simple example from their SDK things don't seem to work! I did all the
WSE settings through the wizard.
Client CodeWSEHost.Service serviceproxy = new WSEHost.Service();
// Specify that MTOM encoding must be used.
serviceproxy.UseDefaultCredentials = true;
// Communicate with the Web service to get the requested file.
byte[] response = serviceproxy.GetFile("foo.txt");
MemoryStream memory = new MemoryStream(response);
// Display the file in a picture box.
//pictureBox1.Image = System.Drawing.Image.FromStream(memory);
using (StreamWriter sw = new StreamWriter(@"C:\vtemp\FooSvc.txt"))
{
using (StreamReader sr = new StreamReader(memory))
{
sw.Write(sr.ReadToEnd());
}
}
Server Codepublic byte[] GetFile(string fileName){
byte[] response;
String filePath = AppDomain.CurrentDomain.BaseDirectory + @"App_Data\" +
fileName;
response = File.ReadAllBytes(filePath);
return response;
}