Comments (7)
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.
That's not so easy to troubleshoot, sadly there are a number of possible issues I can think of.
- 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) - 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
- 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.
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.
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.
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.
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.
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)
- Quick questions about Csla 5.xx HOT 2
- Rocky Lhotka and CSLA .NET AMA survey
- 2 Blazor Questions HOT 7
- HttpProxy Authentication Problem HOT 8
- Including DataPortalController in Blazor.Server HOT 4
- Add virtual to Parent HOT 1
- Blazor ViewModel additional functionality (3 questions) HOT 25
- CSLA version 5.2.0 prerelease 20042401
- Blazor ViewModel GraphMerger error on loading managed property HOT 7
- Live interactive discussion about CSLA .NET May 14, 2020 HOT 6
- CSLA version 5.2.0 prerelease 20042901
- how to convert Csla.ApplicationContext.User to SLMPrincipal class ? HOT 2
- "Data binding" for rules HOT 3
- Dapper and Csla Helper Classes HOT 3
- CSLA 5.2.0-20050802 prerelease
- Require Dependency Injection HOT 7
- Blazor Server Side. Authorization not work when deploy on Azure WebSite with SignalR HOT 2
- Async call for CSLA 5.2.0-R20050802 HOT 2
- NEW FORUM LOCATION HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cslaforum.