Remoting and Web Services

Posts   
 
    
JMichelson
User
Posts: 34
Joined: 27-Dec-2003
# Posted on: 03-Jul-2004 00:36:32   

Ok. Let's step back. WAY back. And look at a bird-eye view of how to use LLBLGen objects in a web services environment.

Here's the thing: LLBLGen objects rely on remoting technology which is great inside the firewall and that accounts for 80% of my application. But, a singificant portion of my application must be accessible to users that may NOT have the .Net framework available to them. For them, web services is necessary.

Assuming that I'm COMPLETELY in the dark (always a good assumption), how does one expose web services using the data objects built with the LLBLGen tool? For example, using a dataobject called "Order" and the generated Order.Save() method, how does one expose that method through a [WebMethod] without having to write a ton of code that translates the web service data into something that the LLBLGen object can understand?

Does this make sense or am I trying to "complicate a ham sandwich"? Has anyone done this?

Thanks. Jeff

Devildog74
User
Posts: 719
Joined: 04-Feb-2004
# Posted on: 04-Jul-2004 20:09:25   

I beleive that this is achieved using XMLSerialization and the .ToXML method of the Entity and Collection objects.

TypedViews and TypedLists derive from datatable, so in that case you could write a web method like so:

'''This is a loosely written method that probably has some syntax issues but you '''should get the point. <WebMethod> Public Function OrdersByCustomer(customerID as int) as dataset dim myList as new typedlistclasses.OrdersByCustomer dim db as new dataAccessAdapter(false)

db.FetchTypedList(myList.GetFieldInfo(), myList)

if myList.count > 0 then dim myData as new dataset(myList) return myData end if

end funtion