September 9, 2003
@ 07:31 AM

My application requires me to extend the functionality provided by typed datasets. Basically, the dataset itself holds information about what has to be "filled()", from which table and using which query. Effectively the Dataset looks like this ...

public class MyDataSet:DataSet {
    /* Autogenerated code to make it a typed dataset using the schema */
    /* Declarations of all DataTables as private members. Again to support being Typed */
    /* My Own variables and Methods that hold some important information about the dataset - Public properties as webservice doesn't return private members */
    /* Definitions of the DataTables in this DataSet */
}

Even the DataTables that are part of this DataSet have been generated from the schema and include custom code to hold extra information about queries, column constraints and parent child info etc ... in the same pattern as the DataSet ... all Typed again ...

Now that I have defined the situation, here is my problem:

I have to populate this dataset from a webservice and then pass it back to the client. I am aware that webservices dont pass back objects, but only the public properties in an XML format. I thought, in this case I would just get the data from the webservice and then create my own instance of the "MyDataSet" class on the client side and copy over all the data that came from the webservice.

Unfortunately this also did not work as when the webservice is returning a class that inherits from "DataSet" it just returns the properties that are in the schema and not even the ones that i manually declared as public in the DataSet code.

Is it possible to write a typed dataset class that has properties other than those defined in the schema ... and be able to return it back from a webservice ... I am ready to copy the data returned into an instance of the custom class on the client side so that then i can use methods in the class as well ...


 
Tuesday, July 05, 2005 9:44:03 PM (Malay Peninsula Standard Time, UTC+08:00)
I have made "XSD" schema files for typed datasets and returned them back from the webservice. What the webservice does is that it just sends the schema back to the client which generates its own proxy using the wsdl.exe tool. I checked the proxy code file (Reference.cs) and it does have a definition for the typed dataset. That is how i am able to use Intellisense on the client side also.
<br>
<br>But my problem is that this time I am not exactly using the MSDataSetGenerator to generate the typed dataset from the XSD. I am using my own convertor. However the webservice does not know this ... so it still derives the schema from the class that i generated ... and sends back only the schema of the dataset (leaving out all the code that i wrote so diligently to handle other things that i need the dataset to do).
<br>
<br>Now on the client side ... when the schema is received, wsdl.exe is again executed by .net to generate the proxy. This uses msdatasetgenerator to generate the code for the dataset schema ... and there lies my problem ... my code is totally lost ... not even the public members that i created on the server side are sent back ... it uses only the schema ...
Nishith Prabhakar
All comments require the approval of the site owner before being displayed.
Name
E-mail
Home page

Comment (Some html is allowed: a@href@title, strike) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview