Error reading parameter : unexpected class found in stream

Working with Remoting SDK 9.4.107 and Delphi 10.2.1

We have a RODL based server which has been converted into code first server.
This conversion has created a _RODLTypes file which contains all auxiliary types (struct , enum etc)
I have generated required files at client side using tools -> RO SDK -> connect to remoting sdk server.

Now , calling a server method which has a complex type parameter is causing exception at server side :

An exception was raised on the server: Error reading parameter Parameter_Name: Unexpected class found in stream; class “Parameter_class_name” does not descend from “Parameter_class_name”.

I have gone through other question posted on this forum regarding this error, but no solution is working for me - (Unexpected class found in stream)

Hi,

try to apply this fix:
uROMessage.pas:

procedure TROMessage.Assign(iSource: TPersistent);
..
    DefaultNamespaces := lSource.fDefaultNamespaces; // changed
  end;
end;

and retest

Note: it may not work with 9.x branch

It is already there.

Is it fixed in later versions of Remoting SDK ?

Hi,

hmm, it can’t be true.
in 9.4 that line was fDefaultNamespaces :=
note: 1st letter was f

Ahh, my bad. Sorry for this.

After this change do I need to regenerate client files as I am still facing same issue ?

No, you should just recompile both projects for making sure that changes are applied


if this fix doesn’t work properly, can you create a simple testcase that reproduces this issue, pls?
you can send it to support@ if you want to keep it privately

Hi , sorry for delayed reply as I was busy with some other task.
The above solution is not working for me , I have created a sample where this issue can be recreated

Please let me know if missed anything.

Hi,

You have included _ServerAccess (NewLibrary_ServerAccess) unit into server-side project.
this unit uses NewLibrary_Intf internally.

as a result, your server-side had two declarations of stCallInfo:

  • NewLibrary_RODLTypes.stCallInfo
  • NewLibrary_Intf.stCallInfo

and it was a reason for this error

workaround: remove NewLibrary_ServerAccess.pas from server-side project and don’t use client-side files in server-side projects.