Return a strong typed Dataset from a WebService to my Client?

G

Guest

I have a windows CE application, talking to a C# WebService. In the
WebService project I have created a dataset (dsJobList), and there is a web
method in there which returns a fully loaded dsJobList dataset to the client,
which in this case is a windows CE device.

In the code for my application on the WinCE device, I have added a Web
Reference to this WebService. Once I have added it I can see the .disco, the
..wsdl and a dsJobList.xsd file. If I open the xsd from within Visual Studio
I can generate the dsJobList.cs and the dsJobList.xsx file.

When I try to build my winCE app now I get an error "The Namespace
MobileAMI.AMi already contains a definition for dsJobList". What am I doing
wrong? Is it possible to do this, define a strong typed dataset in a web
service and send it across to clients??

Thanks

Steve
 
C

cecil

Steve,
When you set a web reference vs.net generates some classes for you
based on the wsdl file for the service. Besides the proxy class for
calling the service it will also generate classes for each complex data
type used as an argument or return value in the service interface (ie
it generates your dsJobList class for you because it is a return type
in the services method). No need to manually pull in the xsd because
that was done for you when you set the web ref.

FYI- if you use a dataset (typed or otherwise) only .Net tools will
recognize them and create a dataset, non .Net tools just give the
client back an xml node and they will then need to parse that
themselves.

Cecil Howell MCT,MSCD,MCAD.Net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top