Zaid-Ajaj / Fable.Remoting

Type-safe communication layer (RPC-style) for F# featuring Fable and .NET Apps
https://zaid-ajaj.github.io/Fable.Remoting/
MIT License
272 stars 54 forks source link

Error in BinarySerialization #257

Closed tforkmann closed 3 years ago

tforkmann commented 3 years ago

Hi there,

i get following issue with the BinarySerialization:

exn Error: Position 441, byte 201, expected type Byte.

The error is probably coming from this patter match.

https://github.com/Zaid-Ajaj/Fable.Remoting/blob/f04255c7cb8c8c3316d1730c12c1a570975281cb/Fable.Remoting.MsgPack/Read.fs#L441

Any idea how to fix that?

When I get rid of BinarySerialization Fable.Remoting works well.

Thanks in advance!

kerams commented 3 years ago

I'd have to see the response type you're trying to serialize. Also make sure your client and server are using the same Fable.Remoting.MsgPack version.

tforkmann commented 3 years ago

Both client and server using Fable.Remoting.MsgPack 1.12 I reduced the qty of rows. Please find the msg attached. The error appears looks like this now: exn Error: Position 753, byte 201, expected type Byte.

Here response type:


type SAPId =
    | SAPId of SAPId: int

type MeterDataRow =
    { SAPId: Ids.SAPId
      AggregateTypeId: byte
      AggregateType: string
      ParameterId: byte
      Parameter: string
      LocationId: Ids.LocationId
      Standort: string
      Datum: DateTime
      Wert: float
      Anlage: string
      Description: string
      Unit: string }

type TechnicalParametersRow =
    { Date: DateTime
      MeterDataRow: MeterDataRow [] }

type TechnicalParameters =
    { Standort: string
      Anlage: string
      MeterDesc: (Ids.SAPId * string) []
      Rows: TechnicalParametersRow [] }

The msg is quite big. msg.txt

kerams commented 3 years ago

Thanks, found the problem. Fix incoming.

tforkmann commented 3 years ago

Awesome!! Works