C# code generation from commandline for a tcp server for a .NET FW codefirst RO server

Code generation from commandline

We are migrating .NET RO/DA servers from RODL based to codefirst.

We notice however that the rodl2code.exe cannot handle a TCP server

How do we generate C# RO (clientside) sourcefiles for a .NET FW project that is codefirst?

Executing

“C:\Program Files (x86)\RemObjects Software\RemObjects SDK (Common)\Bin\rodl2code.exe” tcp://localhost:7789/bin --outfilename:OffNetServer --codedom --type:intf --platform:net --language:cs

results in

Processing RODL file tcp://localhost:7789/bin
Unsupported URL Scheme (tcp)

we are using build 1611.

Note: We cannot use the GUI because the GUI generates C# syntax 8 which is not supported by .NET FW. This last thing is a major shortcoming of the RemObjects SDK IMO.

Hi,

pls uncheck Use new codegen checkbox and press Refresh code:

We don’t use this screen,

we simply rightclick remoteRODL

What’s the advised way from here?

Is there a commandline solution?

Hi,

I can recommend to use simple C# program that downloads RODL from server:

if (args.Length != 2 ) {
	Console.WriteLine("usage:");
	Console.WriteLine("RODLDownloader url output.rodl");
	return;
}
IClientChannel ch = ClientChannel.ChannelMatchingTargetUri(args[0]);
var rodlProvider = ch as IRodlAccess;
if (rodlProvider != null) {	
	RodlLibrary rodl = rodlProvider.RetrieveRodl();
	rodl?.SaveToFile(args[1],true);
}  

later you can pass this RODL to rodl2code.

RODLDownloader.zip (2.6 KB)

What should the URL be?

For my TCP server it does not appear to work

λ …\tools\generateitfdotnet\RODLDownloader.exe tcp://localhost:7789/bin offnet.rodl

Unhandled Exception: System.Exception: Too few bytes read from stream (61942 expected but 0 read)
at RemObjects.SDK.Helpers.StreamHelpers.CopyStreamToStream(Stream source, Stream destination, Int32 count)
at RemObjects.SDK.Helpers.StreamHelpers.CopyStreamToStream(Stream source, Int32 size)
at RemObjects.SDK.IpTcpClientChannel.IRodlAccess.RetrieveRodl()
at RODLDownloader.Program.Main(String args)

E:\p4\main\Source.NET\base\OffNetClient
λ …\tools\generateitfdotnet\RODLDownloader.exe localhost:7789/bin offnet.rodl

Unhandled Exception: System.Exception: No client channel registered for the requested protocol: localhost
at RemObjects.SDK.ClientChannelTypeManager.CreateClientChannelForProtocol(String protocol)
at RemObjects.SDK.ClientChannel.ChannelMatchingTargetUri(Uri uri)
at RODLDownloader.Program.Main(String args)

Hi,

I’ve used

RODLDownloader.exe tcp://localhost:8090 a.rodl

just checked.

RODLDownloader.exe tcp://localhost:8090/bin b.rodl

also works as expected

Both do not work for me

Below you see my server config

I will also attach my binary.

FYI: I use build 1611

var channel = new RemObjects.SDK.Server.IpTcpServerChannel();
channel.SecurityOptions.MaxRequestSize = maxMesSize; // FVC 04/2025: This is needed to avoid package too large errors - see Which parameter to set to fix Package too large error - #22 by fvancrae
server.NetworkServer.ServerChannel =channel;
server.NetworkServer.Port = 7789;
BinMessage message = new BinMessage();
message.MaxMessageSize = maxMesSize;
message.MaxDecompressedMessageSize = maxMesSize;
server.NetworkServer.RegisterServerMessage(message);
Officinall.Utility.LogSystem.LS().AddLog(Officinall.BaseClasses.LogLevel.llInfo, “Starting OffNet RemObjects Server”);
server.Run(args);

RODLDownloader.7z (2.1 KB)

Hi,

I can reproduce this:

investigating …

Hi,

as a temporary workaround, use Delphi-based version of RODLDownloader:
RODLDownloader.zip (523 Bytes)

usage

RODLDownloader tcp://localhost:7789 offnet.rodl

This works, thanks