CodeFirst and Client-Side interfaces - Generates only one interface file

Hi,

pls read https://talk.remobjects.com/t/remoting-sdk-for-delphi-vnext-new-features/18354 , it contains description of this feature

Hi

Following the steps as the text (https://talk.remobjects.com/t/remoting-sdk-for-delphi-vnext-new-features/18354) worked when filtering by the service name in the browser, but isn’t working on the command line using Rodl2code to generate the interfaces.

The following error occurs:

C:\Program Files (x86)\RemObjects Software\RemObjects SDK (Common)\Bin>rodl2code http://localhost:8099/rodl?servicegroup=BINDER --type:intf --platform:delphi --language:delphi outpath:“c:\temp” --namespace:BINDER --codefirst-compatible
Remoting SDK Service Interface Code Generator, based on CodeGen4 (https://github.com/remobjects/codegen4)

Processing RODL file http://localhost:8099/rodl?servicegroup=BINDER
Generating intf
There was a problem loading the RODL.

System.Exception: unknown type: DataParameter
em RemObjects.SDK.CodeGen4.DelphiRodlCodeGen.Intf_generateReadStatement(RodlLibrary library, String aElementType, CGExpression aSerializer, CGCallParameter aName, CGCallParameter aValue, CGTypeReference aDataType, CGCallParameter aIndex)
em RemObjects.SDK.CodeGen4.DelphiRodlCodeGen.Intf_GenerateArray(CGCodeUnit file, RodlLibrary library, RodlArray entity)
em RemObjects.SDK.CodeGen4.DelphiRodlCodeGen.GenerateInterfaceCodeUnit(RodlLibrary library, String aTargetNamespace, String aUnitName)
em RemObjects.SDK.CodeGen4.RodlCodeGen.GenerateInterfaceFile(RodlLibrary library, String aTargetNamespace, String aUnitName)

Hi,

Can you send your RODL (if you are using RODL-based server) or simple testcase (if CodeFirst-based server is used) to support@ for investigation, pls?

Hi,

hmm, it works as expected for me:

C:\Program Files (x86)\RemObjects Software\RemObjects SDK (Common)\Bin>rodl2code
 http://localhost:8099/rodl?servicegroup=BINDER --type:intf --platform:delphi --
language:delphi outpath:"c:\temp" --namespace:BINDER --codefirst-compatible
Remoting SDK Service Interface Code Generator, based on CodeGen4 (https://github
.com/remobjects/codegen4)

Processing RODL file http://localhost:8099/rodl?servicegroup=BINDER
Generating intf
Wrote file .\DATADICT_Intf.pas

can you retest this case with preview (v10) build, pls?

Hi.

I’ll test with version 10.

Taking advantage of the result of your test, I would like to know, how to make the interface file “DATADICT.Intf.pas” get the name of the service “BINDER_Intf”?

This is another problem that I need to solve, when generating the interfaces the files must be with the service name entered in the filter.

Thks.

Hi,

it uses Library.Name for generating _Intf name:

unit DATADICT_RODLTypes;
..
const
  LibraryName = 'DATADICT';

also you can change uRORTTIServerSupport.RODLLibraryName in runtime.

for example, in OnCustomResponseEvent, you can catch request for RODL, analyze query part, change uRORTTIServerSupport.RODLLibraryName, process request for RODL, and change RODLLibraryName back.

note: OnCustomResponseEvent can catch only unknown requests, so you should ask for unhandled request, like http://localhost:8099/customrodl?servicegroup=BINDER

With v10 worked! But I still can’t resolve the problem with the file name.

I tried to use the OnCustomResponseEvent but it doesn’t enter when run the rodl2code command.

Regards.

Hi

please, can you make a small example for the rodl2code to write the name of the file with the name of the service?

I’ve tried a few things here following your suggestion but it’s not working.

Regards.

Unfortunately rodl2code doesn’t allow to customize output file name. This file name always matches either RODL library name (when RODL is downloaded from a remote server by rodl2code itself) or RODL file name (when RODL is loaded from a local file).
Actually you can create a .cmd file that will call rodl2code with desired options and then immediately rename resulting file(s) as you need.

I can add an option to override the output folder.

OnCustomResponseEvent works only for unhandled requests so try to pass something unusual like http://localhost:8099/zzzzz?servicegroup=BINDER or similar

rodl2code will support this parameter in next build:

--outfilename:<name> (optional base filename for generated files, w/o extension)
1 Like

Hi,

when will this improvement be available? could you release a beta test for me?

Regards,

We’re actually doing a new official build right now that will be our later today, Build .1449.

okay I’ll be waiting.

Thanks

.1449 is out now. Enjoy!

Hello,

I’m trying to install this build (.1449) and I giving installation errors.

Also treid to compile the packages but many errors ocorrs too.

  • Delphi version 10.2 (Tokyo)

Regards.

I see late this topic and I don’t know if you are using code first server or RODLs. I have a utility to read from an ini file a list of rodls and produce into files. Can this help you?

If this can be useful for any maybe can be shared on RemObjects GitHub ?

Just let my know.

Best regards

2 Likes

can you sent log.html/log.xml to support@, pls?

what errors were shown?

Attached

(Attachment log.html is missing)

log.xml (28.8 KB)