TypedList returned as XmlElement when using Webservice

Posts   
 
    
hameedAEM1
User
Posts: 17
Joined: 14-Sep-2006
# Posted on: 18-Sep-2006 17:57:03   

Hi,

I have created a typed list and want to return it from my webservice. I am using vs2005/Adapter pattern.

When I call the method on the client side the webmethod appears to return an XMLElement rather then the typedlist object.

I tried to read it into an object data source (the typed list object added to the toolbox when using the generated code) but since it returns an XMLelement it fails.

Hameed.

Rogelio
User
Posts: 221
Joined: 29-Mar-2005
# Posted on: 18-Sep-2006 18:49:25   

Hi,

As far as I know DataTable are not serializable in Net 1.x. The DataTable is serializable in Net 2. Remember that a TypedList inherits from DataTable. What you can do is add the TypedList to a DataSet, return the Dataset from the WebService and take the TypedList from the returned DataSet.

Edit.

I see that you are using VS2005, then you are using Net 2. In this case if you want to return the TypedList directly you need to modify the generate wsdl class of your webservice (I do not remember the details right now). To avoid be changing the wsdl class I would go with option of adding the typedlist to a dataset and returning the dataset.