Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Compact XML for TypedLists?
 

Pages: 1
LLBLGen Pro Runtime Framework
Compact XML for TypedLists?
Page:1/1 

  Print all messages in this thread  
Poster Message
Emmanuel
User



Location:
Ottawa, Canada
Joined on:
13-Jan-2006 23:14:31
Posted:
167 posts
# Posted on: 31-Jan-2006 23:17:56.  
I am new to LLBLGen and am experimenting with it as a potential tool for a webservices app I am writing.

I would like to generate the 'compact' XML for a TypedList. It appears that this is not possible (non of the overloads have 'XMLFormatAspect' as a param type which is required to specify 'compact').

My TypedList is constructed from a selection of columns from a half dozen tables or so.

What can I do instead? Note that I am using self-servicing classes (I don't want to move to adapter classes unless I have to).
  Top
Answer
User



Location:
Phoenix AZ USA
Joined on:
28-Jun-2004 21:13:21
Posted:
363 posts
# Posted on: 01-Feb-2006 03:09:20.  
a typedlist is nothing more then a datatable, thats why there is no compact option.

  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14584 posts
# Posted on: 01-Feb-2006 06:51:14.  
If you move around with dataTables (TypedLists), it won't differ to use Selfservicing or Adapter.

Yet Webservices don't transfer dataTables, you'll have to enclose them in a dataSets.

If your TypedLists have fields that youy don't want, you may consider building your own dynamic lists.

Please refer to: "Using the generated code - SelfServicing - Using dynamic lists"
in the LLBLGen Pro documentation.
  Top
Emmanuel
User



Location:
Ottawa, Canada
Joined on:
13-Jan-2006 23:14:31
Posted:
167 posts
# Posted on: 01-Feb-2006 16:04:26.  
Walaa wrote:
Yet Webservices don't transfer dataTables, you'll have to enclose them in a dataSets.

I can't seem to find any reference help on Datasets. I do a search on it and get references to classes with Dataset properties but clicking on one of those hyperlinks sends me to an invalid page in the help file. Just more FYI than anything else since it doesn't sound like Datasets will work for me since I need a subset of fields from multiple tables in my compact XML message.

Walaa wrote:
If your TypedLists have fields that youy don't want, you may consider building your own dynamic lists.

Thanks. I read up on dynamic lists. It might work for me but I am now thinking that it would be easier for me if I used a class mapped to a db view (TypedView, I guess). If I could filter the rows in the view programmatically and then serialize it to 'compact' XML, I think that would be ideal for me. If using a view-mapped class is possible I'm guessing that I am back to using datasets, right? If so, where can I get more info on datasets (see my comments above).

By the way, if I need to go with dynamic lists I don't see a WriteXML method for TypedListDOA class. How do I serialize a dynamic list to XML?


  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37860 posts
# Posted on: 02-Feb-2006 11:54:59.  
Emmanuel wrote:
Walaa wrote:
Yet Webservices don't transfer dataTables, you'll have to enclose them in a dataSets.

I can't seem to find any reference help on Datasets. I do a search on it and get references to classes with Dataset properties but clicking on one of those hyperlinks sends me to an invalid page in the help file. Just more FYI than anything else since it doesn't sound like Datasets will work for me since I need a subset of fields from multiple tables in my compact XML message.

Type
dLists and TypedViews are derived classes from DataTable. They don't contain their own XML serialization code, but have to be used with a dataset.

So if you want to return a typedlist/view from a webmethod, you do:
Code:

[WebMethod]
public DataSet GetCustomers()
{
    CustomersTypedList customers = new CustomersTypedList();
    // fill it
    ...
    DataSet dummy = new DataSet();
    dummy.Tables.Add(customers);
    return dummy;
}


The XML serialization code in .NET 1.x for DataTable objects is build inside the DataSet, not inside the DataTable. In .NET 2.0 you can just return the typedlist/typedview and it will work. There's no compact XML flag as the xml is produced by .NET, not by our code.

Quote:

Walaa wrote:
If your TypedLists have fields that youy don't want, you may consider building your own dynamic lists.

Thanks. I read up on dynamic lists. It might work for me but I am now thinking that it would be easier for me if I used a class mapped to a db view (TypedView, I guess). If I could filter the rows in the view programmatically and then serialize it to 'compact' XML, I think that would be ideal for me. If using a view-mapped class is possible I'm guessing that I am back to using datasets, right? If so, where can I get more info on datasets (see my comments above).

By the way, if I need to go with dynamic lists I don't see a WriteXML method for TypedListDOA class. How do I serialize a dynamic list to XML?

Same as a typedlist/view: add it to a DataSet, use WriteXml on the DataSet.
Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Emmanuel
User



Location:
Ottawa, Canada
Joined on:
13-Jan-2006 23:14:31
Posted:
167 posts
# Posted on: 02-Feb-2006 14:51:40.  
Thanks Otis. I understand.


  Top
Bing Ping
User



Location:
U.S.A
Joined on:
21-Dec-2012 17:34:40
Posted:
15 posts
# Posted on: 25-Jan-2013 18:47:15.  
Emmanuel wrote:
Thanks Otis. I understand.


I just updated my code from 2.0 to 3.1 and found the webmethod that is used to return
typedlist/typedview now returns dataset/datatable. And the reference.cs is auto-generated. It is weird. Is something wrong with LLBLGen pro 3.1?

I am using VS 2010 C# with framework 3.5.

  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37860 posts
# Posted on: 26-Jan-2013 11:45:31.  
I'll close this thread as your question has nothing to do with the thread you re-opened. Start a new thread for your problem please. It's not the first time you do this, please start a new thread for your own problem, don't re-open random old threads which have no relationship with your problem.

Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.