EntityCollection instead of DataSet as return Type in Web Service

Posts   
 
    
IndrajeetP
User
Posts: 8
Joined: 21-Sep-2006
# Posted on: 27-Sep-2006 09:10:13   

Hi people,

I am trying to build web services (VS 2005) using the Adapter pattern.

As suggested by OTIS in a thread (http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=6728&HighLight=1), I have enabled the schemaimporter task in my LLBLGen project. (I could not find the webservicehelper generator task though).

I am through with the implementation of the service and am able to test the results in browser through the asmx file. However, when I try to access the web service by adding Web Reference to a CLIENT project, I face the following two problems: 1) Even though I return EntityCollection from my webmethods, the proxy generated for the service has DataSets as the return type. I would prefer having the EntityCollection as the return type. 2) If I decide to go ahead with the DataSet return type, I still have a problem. Even though my service's webmethod returns a collection with objects in it(I tested this by debugging and also in browser), the dataset that I receive through the proxy doesnt have any Tables in it.

I have also gone through a few other threads: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=2913&HighLight=1 http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=145&HighLight=1 http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=4973&HighLight=1 http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=4429 http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=6728&HighLight=1

But I couldnt find solution to my problem. I am not sure if I am missing anything.confused

Can anyone, please let me know where I am going wrong? If somebody could list the steps precisely (for making web services with LLBLGen work) that would definitely help a lot.

Thanks!simple_smile

Regards, Indrajeet

mihies avatar
mihies
User
Posts: 800
Joined: 29-Jan-2006
# Posted on: 27-Sep-2006 10:38:22   

First question you have to ask yourself is why web services and not remoting? If you want to make the service available to non .net applications (and thus using a web service approach) then you are better off passing only simple data types and not collections.

IndrajeetP
User
Posts: 8
Joined: 21-Sep-2006
# Posted on: 27-Sep-2006 10:52:36   

Well mihies,

The consumers of my service will consist of .Net as well as non.Net clients. Hence, I have to use web services. At the same time, I would like my clients to receive entities and not DataSets. I am not sure whether this is possible for non.Net clients. But there must be some way for the .Net ones.

Regards, Indrajeet

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 27-Sep-2006 17:48:56   

This is discussed in depth in the documentation. Please see: Using the generated code: XML Webservices support

Frans Bouma | Lead developer LLBLGen Pro
worldspawn avatar
worldspawn
User
Posts: 321
Joined: 26-Aug-2006
# Posted on: 28-Sep-2006 04:27:36   

I had this working with adapter classes generated in v2, then I switched to virtually the same classes generated in v1 and I can't get it to work anymore. Is there something inbuilt into the adapter classes that triggers the schema importer. I logged all the calls made to it and none are even for my web services namespace.

I have a few methods that accept an int and return a boolean, so I guess that what their about. What's going on with my entity classes and EntityCollection?

Log: (ns and then type)


http://www.w3.org/2001/XMLSchema
int
http://www.w3.org/2001/XMLSchema
boolean
http://www.w3.org/2001/XMLSchema
int
http://www.w3.org/2001/XMLSchema
boolean
http://www.w3.org/2001/XMLSchema
int
http://www.w3.org/2001/XMLSchema
boolean

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 28-Sep-2006 08:14:44   

Please refer to v.1 manual: "Using the generated code -> XML Webservices support"

IndrajeetP
User
Posts: 8
Joined: 21-Sep-2006
# Posted on: 28-Sep-2006 13:04:54   

Thanks! simple_smile

I missed out that part of the documentation. I ll have a look at it.

In the mean time, I am busy with another thing: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7726

Keeping you people busy. smile

Regards, Indrajeet