Expose DataSet for web service client  
Author Message
JanJan





PostPosted: ASMX Web Services and XML Serialization, Expose DataSet for web service client Top

Hi:
I have a web service with a typed dataset defined. I also got a windows form as a web client to consume the web service. In the win form project I successfully added a web reference to the web service but was not able to reference the typed dataset defined in that web service. I took a look at the Issuevision sample and confirmed that the client was able to reference the typed dataset referenced in the web service. So I'm missing something here hope that someone can give me a hint.

Both solutions were developed in the VS 2005.

Much appreciated.



.NET Development10  
 
 
rfreire





PostPosted: ASMX Web Services and XML Serialization, Expose DataSet for web service client Top

Let me understand your problem here....

When you said you're unable to reference the dataset in the client.... do you mean that the dataset is not there in the generated proxy class

Is the dataset defined as parameter or return value of a webmethod in your service

Rgsd, Rodrigo


 
 
JanJan





PostPosted: ASMX Web Services and XML Serialization, Expose DataSet for web service client Top

Hi Rodrigo:

>do you mean that the dataset is not there in the generated proxy class

Correct. The dataset is not there.

>Is the dataset defined as parameter or return value of a webmethod in your service

It is defined as a private member of my web service as this is how it was done when i drag & drop a dataset into the .asmx designer windows. so the code looks like:

public class MyWebService : System.Web.Services.WebService
{
private MyTypeDataSet ds1;

.......

}

I'm sure i have missed something here please advice. Thanks.



 
 
rfreire





PostPosted: ASMX Web Services and XML Serialization, Expose DataSet for web service client Top

The dataset is defined as a private member in your service but it is never used as a parameter type or return value, right

This means that the dataset is not part of the "contract" of the service, so it is not exposed in the proxy class as it is not needed.

Please, try to add a webmethod that receives a MyTypeDataSet as parameter to see if it fixes the problem.

Rgds, Rodrigo


 
 
JanJan





PostPosted: ASMX Web Services and XML Serialization, Expose DataSet for web service client Top

Hi Rod:

Yes, I got the referenced Dataset once have a return method returned to it. As it is my first time writing web service this certainly is one of the many things i'm getting start with.

Thanks!!