Coder Social home page Coder Social logo

Comments (7)

rockfordlhotka avatar rockfordlhotka commented on September 26, 2024 1

It is hard to help without the full ToString output from the exception. You need to capture that and provide the results here.

from cslaforum.

rockfordlhotka avatar rockfordlhotka commented on September 26, 2024 1

That's not so easy to troubleshoot, sadly there are a number of possible issues I can think of.

  1. There might be a size limit on the HttpClient in iOS causing the response data to get cut off mid-stream - so maybe you can raise that limit (if there is one)
  2. You might be getting some unexpected server error like a 404 or 5xx or something - and the deserialization process fails because it isn't a binary data feed as expected; using Fiddler can help
  3. I've seen something like this when a specific type can't be serialized - specifically when trying to pass a custom principal/identity type - and I don't know what that happened, but it seems vaguely similar

I'd recommend putting Fiddler on the wire so you can see exactly what is going over the network.

from cslaforum.

animjn avatar animjn commented on September 26, 2024 1

Thanks Rocky! What's a bit baffling is that, I've setup duplicate Dataportals in Azure in .NET 4.7 and .NET Core 3.1, based on samples and only the following single case gives an exception.

  • Dataportal on .NET 4.7 from Android - WORKS ✓
  • Dataportal on .NET 4.7 from iOS - WORKS ✓
  • Dataportal on .NET Core from Android - WORKS ✓
  • Dataportal on .NET Core from iOS - EXCEPTION ✗

from cslaforum.

rockfordlhotka avatar rockfordlhotka commented on September 26, 2024 1

Agreed, I don't know what is going on. I assume you've done some searching to find out of HttpClient works differently on iOS or something like that?

I suppose you could try the gRPC data portal channel and see if that's any different. I suspect not though, because I have a hunch that gRPC might use HttpClient behind the scenes (?).

from cslaforum.

animjn avatar animjn commented on September 26, 2024

Thank you for looking into it. The following is the complete ex.ToString(). The AppServerCore project is setup similar to ProjectTracker 5.1. I receive the following only on connecting from iOS

Csla.DataPortalException: Unable to read beyond the end of the stream.
  at Csla.DataPortalClient.HttpProxy.Update (System.Object obj, Csla.Server.DataPortalContext context, System.Boolean isSync) [0x00163] in <feea9dc9b09a48e6b208754bd584bf7b>:0 
  at Csla.DataPortal`1[T].DoUpdateAsync (T obj, System.Boolean isSync) [0x0066f] in <feea9dc9b09a48e6b208754bd584bf7b>:0 
  at Csla.DataPortal`1[T].ExecuteAsync (T command) [0x00069] in <feea9dc9b09a48e6b208754bd584bf7b>:0 
  at Csla.DataPortal.ExecuteAsync[T] (T command) [0x00065] in <feea9dc9b09a48e6b208754bd584bf7b>:0 
  at Avs.Site.Library.Utility.VerifyServerUri (System.String uri) [0x000c7] in C:\Users\ash\Documents\Source\Site\Avs.Site.Library\Utility\Utility.cs:135 
  at Avs.Site.UI.Shared.Views.ConnectionSettingsPage.TryVerifyServerURI (System.String uri) [0x00035] in C:\Users\ash\Documents\Source\Site\Avs.Site.UI.Shared\Views\Settings\ConnectionSettingsPage.xaml.cs:232 

System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
   at System.IO.BinaryReader.InternalRead(Int32 numBytes)
   at Csla.Serialization.Mobile.CslaBinaryReader.Read(Stream serializationStream)
   at Csla.Server.Hosts.HttpPortalController.InvokePortal(String operation, Stream requestStream, Stream responseStream)

from cslaforum.

Bowman74 avatar Bowman74 commented on September 26, 2024

You might be running into App Transport Security. Is your dataportal connection using HTTPS with at least TLS 1.2? If not have you added your endpoint as an exception in the info.plist?

See the following:
https://docs.microsoft.com/en-us/xamarin/cross-platform/macios/http-stack

Edit to add: The MS docs are wrong on the defaults. New projects use NSUrlSession for the underlying handling of HttpClient which will run into ATS restrctions.

from cslaforum.

animjn avatar animjn commented on September 26, 2024

Hi! After seeing a related post I tried to reproduce it with Project Tracker and log the raw response using Fiddler -

HTTP/1.1 200 OK
Server: Microsoft-IIS/10.0
X-Powered-By: ASP.NET
Date: Mon, 18 May 2020 13:40:47 GMT
Content-Length: 1136 

���������.Csla.Server.Hosts.HttpChannel.HttpResponse, /c���������
_fieldManager������������������+Csla.Core.FieldManager.FieldDataManager, /c���������    ErrorData���������������_businessObjectType������������sCsla.Server.Hosts.HttpChannel.HttpResponse, Csla, Version=5.1.0.0, Culture=neutral, PublicKeyToken=93be5fdc093e4c30�
GlobalContext������������
ObjectData����������������/Csla.Server.Hosts.HttpChannel.HttpErrorInfo, /c���������������������������������������������������tCsla.Server.Hosts.HttpChannel.HttpErrorInfo, Csla, Version=5.1.0.0, Culture=neutral, PublicKeyToken=93be5fdc093e4c30��ExceptionTypeName    �����������System.IO.EndOfStreamException��Message
����������,Unable to read beyond the end of the stream.��Source������������System.Private.CoreLib�
StackTrace�������������   at System.IO.BinaryReader.InternalRead(Int32 numBytes)
   at Csla.Serialization.Mobile.CslaBinaryReader.Read(Stream serializationStream)
   at Csla.Serialization.Mobile.MobileFormatter.Deserialize(Stream serializationStream)
   at Csla.Server.Hosts.HttpPortalController.InvokePortal(String operation, Stream requestStream, Stream responseStream)

from cslaforum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.