[Problem]
Having created a shared library that is to be deployed on a server machine and client machine how do I communicate between the client-server with the classes provided by the library?
Transferring the information via webservices does not seem to work as the serialised object returned by the web service is a webservice class which does not convert to the shared library.
Am I using the webservices incorrectly? Is there a better way?
[Example]
MyLibrary.cs and SubLibrary.cs is in a shared assembly that is to be used by the client app.
MyLibrary.cs
public class MyLibrary
{
private SubLibrary sublib = new SubLibrary();
public class MyLibrary()
{
}
public string GetValue()
{
return sublib.GetValue();
}
}
SubLibrary.cs
public class SubLibrary
{
private string str = "Hello World";
public SubLibrary()
{
}
public string GetValue()
{
return str;
}
}
WebService.asmx.cs
[WebMethod]
public MyLibrary GetInfo()
{
return new MyLibrary();
}
Client App
private void GetInfo_Click(object sender, System.EventArgs e)
{
WS.WebService services = new WS.WebService();
MyLibrary info = services.GetInfo(); // This of course doesn't convert.
MessageBox.Show(info.GetValue());
}