R
Russ
I'm still very new to .NET. I managed to write a web service using
managed extensions for C++ and integrate it with existing business
logic. The web client is written in C#. To receive bunch of strings
from the server, the client does this:
String [] n = ws.GetEmployeeInfo (empno);
Name.Text = n [0];
Department.Text = n [1];
Type.Text = n [2];
Period.Text = n [3];
PayType.Text = n [4];
PayRate.Text = n [5];
CheckDate.Text = n [6];
This works, but now I need to retrieve more hetrogeneous data. What I
would like to do is create a class and pass it from the service to the
client (and vice versa at times). So the code would then look more
like:
MyClass data = ws.GetEmployeeInfo (empno);
Name.Text = data.Name;
Department.Text = data.Dept;
etc, and then I could have other data types in the class such as bool
and double..
My problem is how does the C++ service and the C# client each know
what the class looks like? Is there a way to put the class definition
in a header file and include it in both sources? I realize that the
data is passed via XML and so the field names and types are passed,
but again, how do I tell the server to use a class that the client
will understand?
I have tried to understand the concept of a dataset and see if it
could be used, but it incapsulates way more functionality than I need,
and I still don't see how the C++ web service can know what it looks
like, and how to fill it. This data does not come out of a relational
database, so using SQL, OleDB and OBDC does not make any sense (at
least to me).
Thanks for any help.
Russ
managed extensions for C++ and integrate it with existing business
logic. The web client is written in C#. To receive bunch of strings
from the server, the client does this:
String [] n = ws.GetEmployeeInfo (empno);
Name.Text = n [0];
Department.Text = n [1];
Type.Text = n [2];
Period.Text = n [3];
PayType.Text = n [4];
PayRate.Text = n [5];
CheckDate.Text = n [6];
This works, but now I need to retrieve more hetrogeneous data. What I
would like to do is create a class and pass it from the service to the
client (and vice versa at times). So the code would then look more
like:
MyClass data = ws.GetEmployeeInfo (empno);
Name.Text = data.Name;
Department.Text = data.Dept;
etc, and then I could have other data types in the class such as bool
and double..
My problem is how does the C++ service and the C# client each know
what the class looks like? Is there a way to put the class definition
in a header file and include it in both sources? I realize that the
data is passed via XML and so the field names and types are passed,
but again, how do I tell the server to use a class that the client
will understand?
I have tried to understand the concept of a dataset and see if it
could be used, but it incapsulates way more functionality than I need,
and I still don't see how the C++ web service can know what it looks
like, and how to fill it. This data does not come out of a relational
database, so using SQL, OleDB and OBDC does not make any sense (at
least to me).
Thanks for any help.
Russ