typedlist, typedview, entity, entitycollection return dataset

Posts   
 
    
Bing Ping
User
Posts: 15
Joined: 21-Dec-2012
# Posted on: 26-Jan-2013 19:14:21   

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 samething happends to entity and entitycollection.

I have a web application with EDMZ, IDMZ and WS. The WS uses the dll generated by LLBLGen and IDMZ calls WS. EDMZ retrieves data from IDMZ.

The system works fine in LLBLGen pro v2.0 with framework 2.0 but not LLBLGen pro v3.1 with framework 3.5.

I only updated the code from LLBLGen 2.0 to 3.1 and keep all other code intact.

Conversion of the code from LLBLGen pro 2.0 to 3.1 is done successfully. The problem is when you use it in the web service. The reference.cs which is auto-generated changed all Entity, Entity Collection, TypedView and TypedList to dataset.

For your information, I am using VS 2010 C# with framework 3.5 and The LLBLGen pro v3.1.

My question is Why VS 2010 cannot understand LLBLGen pro's code when generating web proxy server for the web service?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 28-Jan-2013 02:43:28   

Are you sure you are using .NetFramework 3.5? It might be that you updated to VS2010 but your server/client projects still use .NetFramework 2.0. The thing with .Net20 is that you have to live with proxy classes. This is explained in XML Webservices - Example usage with especial attention in "The client" section. Also read .NET 2.0 Specific: Schema importers to know the proper steps to get it working.

Now, if you are using .NET 3.0+, then you are using WCF. Here are the instructions for that....

David Elizondo | LLBLGen Support Team
Bing Ping
User
Posts: 15
Joined: 21-Dec-2012
# Posted on: 14-Mar-2013 20:04:30   

Thanks.

I am using WCF. I have one question. In ServiceContract, how to define TypedView and TypedList. I used this way and got an error.

[ServiceContract] [SeriviceKnownType(typeof(MyTypedView))] [SeriviceKnownType(typeof(MyTestTypedList))]

Error: An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is: System.InvalidOperationException: An exception was thrown in a call to a WSDL export extension: System.ServiceModel.Description.DataContractSerializerOperationBehavior contract: http://tempuri.org/:IService ----> System.NullReferenceException: Object reference not set to an instance of an object.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 15-Mar-2013 03:14:01   

How looks the signature of your web method? Remember that TypedViews and TypedLists are all DataTables, so you also could just make the method return a DataTable:

public DataTable ReturnSomething()
{
     //return my TypedView....
}
David Elizondo | LLBLGen Support Team
Bing Ping
User
Posts: 15
Joined: 21-Dec-2012
# Posted on: 15-Mar-2013 16:13:14   

I saw one sample from your forum. Can I do this way?

In service:

from

public VwScriptEventsTypedView FetchScriptEventsHist(Guid scriptId) { return service.FetchScriptEventsHist(scriptId); } To

public ITypedView FetchScriptEventsHist(Guid scriptId) { return (ITypedView) service.FetchScriptEventsHist(scriptId); }

In Interface:

    [OperationContract]
    ITypedView FetchScriptEventsHist(Guid scriptId);
daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 18-Mar-2013 05:11:06   

The error you are getting, Is it on the client side? What is the client application and are you using the same contract at your client side?

Depending of the kind of client you are using, you also may return just DataTable objects. Ref: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=19646&StartAtMessage=25&#110895

David Elizondo | LLBLGen Support Team