Csla-4.5.30, PagedList project generating excep. Dataportal_Fetch not implemented.

Csla-4.5.30, PagedList project generating excep. Dataportal_Fetch not implemented.

Old forum URL: forums.lhotka.net/forums/t/12181.aspx


acheema posted on Friday, October 11, 2013

Hi everyone,

We been using Csla from v2.0 in Web/Windows application. Now we decided to move some of our Web_App use case to Silverlight. We downloaded current 4.5.30 framework version and trying to run PagedList application under silverlight/cs folder. Application got compiled ok, but it is generation exception on line 44  [DalaList.cs  -> DataPortal.BeginFetch<DataList>(new PagedCriteria(0, 10, true), callback);] , as folows

Csla.DataPortalException: DataPortal.Fetch failed (DataList.DataPortal_Fetch not implemented) ---> Csla.Reflection.CallMethodException: DataList.DataPortal_Fetch method call failed ---> System.NotImplementedException: DataList.DataPortal_Fetch not implemented

   at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)

   at Microsoft.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)

   at Microsoft.Runtime.CompilerServices.TaskAwaiter`1.GetResult()

   at Csla.Reflection.LateBoundObject.<CallMethodTryAsync>d__3.MoveNext()

   --- End of inner exception stack trace ---

   at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)

   at Microsoft.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)

   at Microsoft.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()

   at Csla.Server.SimpleDataPortal.<Fetch>d__7.MoveNext()

   --- End of inner exception stack trace ---

   at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)

   at Microsoft.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)

   at Microsoft.Runtime.CompilerServices.TaskAwaiter`1.GetResult()

   at Csla.DataPortal`1.<BeginFetch>d__1e.MoveNext()

The call is going to ObjectFactory class in PagedListDal.cs or if someone know how to debug the code when running async under background thread. 

We kind of stuck in between, if some one had got through this exception before or anyone had tested this application before. An early response would be appreciated. 

 

 

g.beraudo@castsoftware.com replied on Saturday, October 12, 2013

Hi,

I have not tried to run this specific sample but, from my understanding:

- does page list contains a DataPortal_Fetch method with a PagedCriteria signature

- is your client/server settings setup correctly: this method might not be present in the Silverlight code / only available in the server code, and the local portal might be configured.

Regards,

Gilles

acheema replied on Saturday, October 12, 2013

Thanks Gillies the response, DataList is configured to use ObjectFactory, DataListDal. Aslo App is configured to use WcfDataPortal and its setting are put in ServiceReferences.clientconfig file. So what i assume, when dp.Beginfetch call starts, it should run on bg thread, and on server side control should move in DataListDal.Fetch method. I also commented out the ObjectFactory attribute, and put my own DataPortal_Fetch method in DataList.server file, but result is the same exception.

Regards.

Asad Cheema.

acheema replied on Saturday, October 12, 2013

Also when we debug into Csla code, (line 76-Csla.server.DataPortalSelector - > context.FactoryInfo = ObjectFactoryAttribute.GetObjectFactoryAttribute(objectType);) returning null, even though ObjectFactory attribute is defined as follows in  DataList.cs (in Library.Net)

#if !SILVERLIGHT
  [Csla.Server.ObjectFactory("DataAccess.DataListDal,DataAccess")]
#endif 

So it looks like ObjectFactory Attribute is not reading by the framework correctly, thats why it is looking  local DataPortal_Fetch method.

Any help to resolve this is appreciated.  Thanks in advance.

Asad.

acheema replied on Sunday, October 13, 2013

And further debugging the sample app, looks like when bw.RunWorkerAsync(); statement executes, it is still looking DataPortal_XYZ in client's dll i.e. Library.Silverlight. Obviously ObjectFactoery is not defined there.

Any this we missed in WcfDataPortal configuration to goto Remoteserver?

Regards.

Asad Cheema.

JonnyBee replied on Tuesday, October 15, 2013

Hi,

Unfortunately this sample hasn't been updated to run in CSLA 4.5.x

The basic necessary steps to get it running is:

    DataList.cs:

  [ObjectFactory("DataAccess.DataListDal, DataAccess")]
  [Serializable]
  public class DataList : BusinessListBase<DataListDataItem>

App.Xaml

    private void Application_Startup(object sender, StartupEventArgs e)     {       Csla.ApplicationContext.DataPortalProxy = typeof(Csla.DataPortalClient.WcfProxy).AssemblyQualifiedName;       Csla.ApplicationContext.DataPortalUrlString = "http://localhost:29082/WcfPortal.svc";       this.RootVisual = new MainPage();     }
WcfPortal.cs:
<% @ServiceHost Service="Csla.Server.Hosts.Mobile.WcfPortal" %>
web.config
      <service behaviorConfiguration="WcfPortalBehavior" name="Csla.Server.Hosts.Mobile.WcfPortal">         <endpoint address="" binding="basicHttpBinding" contract="Csla.Server.Hosts.Mobile.IWcfPortal">

 

 

 

acheema replied on Thursday, October 17, 2013

Thanks jonny, it worked. That App.Xml settings were not there, i was assuming Silverlight will be setting up using ServiceReferences.ClientConfig. 

Anyway thanks again. I assume same kind of changed will be required to execute other samples too.

Regards.

Asad Cheema.

Copyright (c) Marimer LLC