S
Steve
I am using an XMLSerializer to create an xml object of a
class in a web application. I am then using an XMLWriter
to place this into a memory stream. No problems so far.
I have a web service that is to receive a
System.IO.MemoryStream object and then deserialize it to
retrieve the require information.
When I try to make the call to the WebMethod from my web
application the IDE is showing that it is not expecting a
System.IO.MemoryStream object, but is expecting an object
of type <WebService>.<Service>.MemoryStream i.e.
WebApplication.WebService.SystemMemoryStream.
If I just pass my memory stream object I get the compile
error: Cannot Convert from 'System.IO.MemoryStream'
to 'WebApplication.WebService.MemoryStream'.
Any ideas on why this isn't working? Or is there a better
way to do this???
---- Sample code from WebApp (user is my object) ----
XmlSerializer serializer = new XmlSerializer(typeof(User));
XmlWriter memWriter = new XmlTextWriter(ms, Encoding.UTF8);
serializer.Serialize(memWriter, user);
HiBISws.Control webService = new HiBIS.HiBISws.Control();
webService.Login(ms);
---- Sample code from Web Service ----
[WebMethod]
public void testStream(System.IO.MemoryStream ms)
{
//Do nothing yet
Console.WriteLine("test ms");
}
class in a web application. I am then using an XMLWriter
to place this into a memory stream. No problems so far.
I have a web service that is to receive a
System.IO.MemoryStream object and then deserialize it to
retrieve the require information.
When I try to make the call to the WebMethod from my web
application the IDE is showing that it is not expecting a
System.IO.MemoryStream object, but is expecting an object
of type <WebService>.<Service>.MemoryStream i.e.
WebApplication.WebService.SystemMemoryStream.
If I just pass my memory stream object I get the compile
error: Cannot Convert from 'System.IO.MemoryStream'
to 'WebApplication.WebService.MemoryStream'.
Any ideas on why this isn't working? Or is there a better
way to do this???
---- Sample code from WebApp (user is my object) ----
XmlSerializer serializer = new XmlSerializer(typeof(User));
XmlWriter memWriter = new XmlTextWriter(ms, Encoding.UTF8);
serializer.Serialize(memWriter, user);
HiBISws.Control webService = new HiBIS.HiBISws.Control();
webService.Login(ms);
---- Sample code from Web Service ----
[WebMethod]
public void testStream(System.IO.MemoryStream ms)
{
//Do nothing yet
Console.WriteLine("test ms");
}