MarimerLLC / cslaforum

Discussion forum for CSLA .NET
https://cslanet.com
Other
31 stars 6 forks source link

CSLA Version With 4.6.200 Issues With Xamarin Android #124

Open aneeshg2t opened 8 years ago

aneeshg2t commented 8 years ago

Hi Team,

I works with a sample application with csla version 4.5.601. Using that version i can able to interact with business object. So tried to updated entire project with csla version 4.6.200.

Using the latest version I can't able to interact with business object. It throwing an error

"Type GenericPrincipal must implement IMobileObject".

Some points that I noticed with latest version is ...

1) In the android support library, without adding "System.ComponentModel.DataAnnotations" we can't able to Android Support Library project...

But csla version 4.5.602 there is no need of "System.ComponentModel.DataAnnotations"..

Thanks & Regards

Aneesh S

aneeshg2t commented 8 years ago

Adding these lines into the project.. "Csla.ApplicationContext.User = new Csla.Security.UnauthenticatedPrincipal();"

Its throwing another error ... In Xamarin Android

Error in deserializing body of request message for operation 'Fetch'. OperationFormatter encountered an invalid Message body. Expected to find node type 'Element' with name 'Fetch' and namespace 'http://ws.lhotka.net/WcfDataPortal'. Found node type 'Element' with name 'FetchAsync' and namespace 'http://ws.lhotka.net/WcfDataPortal' (Fault Detail is equal to Error in deserializing body of request message for operation 'Fetch'. OperationFormatter encountered an invalid Message body. Expected to find node type 'Element' with name 'Fetch' and namespace 'http://ws.lhotka.net/WcfDataPortal'. Found node type 'Element' with name 'FetchAsync'

In Xamarin iOS MonoTouch does not support dynamic proxy code generation. Override this method or its caller to return specific client proxy instance


How can solved these issues .... Anything need to update with serialization classes ?

aneeshg2t commented 8 years ago

@rockfordlhotka Reference project ... Kindly check the below mentioned link https://www.dropbox.com/s/j9uifhgof9l6n5o/SimpleNTier_Csla_4_6_200.zip?dl=0

rockfordlhotka commented 8 years ago

The issue with GenericPrincipal is that it is a type provided by the BCL, not by CSLA, and it isn't serializable in all cases.

You should always set your principal object to something known to be serializable as the application starts, such as UnauthenticatedPrincipal.

aneeshg2t commented 8 years ago

@rockfordlhotka

How can I resolve this issue on business object class ? What are the necessary things that I should updates on Business project....

rockfordlhotka commented 8 years ago

I don't see an obvious issue, and haven't had time to try and replicate your issue. I hope to have time either today or tomorrow.

aneeshg2t commented 8 years ago

@rockfordlhotka

Thanks for your feedback. Actually I stuck that part. Kindly refer the project ... https://www.dropbox.com/s/j9uifhgof9l6n5o/SimpleNTier_Csla_4_6_200.zip?dl=0

rockfordlhotka commented 8 years ago

One thing that occurs to me - you aren't trying to use the WcfProxy are you? It doesn't work at this time, and making it work is on the backlog for the next release. Right now only the HttpProxy is available.

aneeshg2t commented 8 years ago

@rockfordlhotka

Let me know what are the necessary things that should get updated while using HttpProxy. Whether I need to update the hosting service or else ?

Kindly help us which CSLA _version should get work with _WCFProxy?

rockfordlhotka commented 8 years ago

The issue for getting WcfProxy to work on Android is this: https://github.com/MarimerLLC/csla/issues/484

rockfordlhotka commented 8 years ago

To use HttpProxy you do need to set up a service endpoint using HttpPortal, and then configure the client to use HttpProxy.

You can see the Xamarin client configuration here: https://github.com/MarimerLLC/csla/blob/master/Samples/ProjectTracker/ProjectTracker.Ui.Xamarin/ProjectTracker.Ui.Xamarin/App.cs

And you can see the app server controller here (implements the endpoint): https://github.com/MarimerLLC/csla/blob/master/Samples/ProjectTracker/ProjectTracker.AppServerHost/Controllers/DataPortalController.cs

aneeshg2t commented 8 years ago

@rockfordlhotka

Instead of using WCF service, we should create our own MVC WEB API Project. Right ? Is it compatible with ASP.NET MVC 4? Or we should work with latest ??

aneeshg2t commented 8 years ago

@rockfordlhotka

Thanks for supporting.

Is there any possibility to use WCFProxy _with older CSLA Version instead of _CSLA-Core 4.6.200. I tried with CSLA-Core 4.6.100. It also throwing the same error with Xamarin Android Application.

rockfordlhotka commented 8 years ago

I don't think it has been functional since 4.6

aneeshg2t commented 8 years ago

@rockfordlhotka

Thanks Rocky.

Now we can able to get data from Business Object. I tested both iOS _& _Android _application , with the help of _HttpProxy..

rockfordlhotka commented 8 years ago

I am glad your code is now working!