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

I can’t make this change. Please, can you help me?

you can use this sample: rocg4_helper.zip (53.2 KB)

it may work with local RODL or can process RODL from http://localhost:8099/rodl or http://localhost:8099/rodl?servicegroup=XXXX

Hi

I’m getting this error when trying (ROWinInetHTTPChannel1 as IROMetadataReader).RetrieveRODL(rodl);

Exception class EROException with message ‘Cannot load XML document.
Reason: Caractere inválido encontrado no texto.
Line: 1
Position: 6’.

Hi,

what URL is set in ROWinInetHTTPChannel? http://localhost:8099/rodl?servicegroup=XXXX ?

This sounds like you’re not getting back a valid XML file from whatever URL you’re using?

http://localhost:8099/rodl?servicegroup=LOGIN

if you open this link in browser - RODL will be shown correctly?
Do you use my rocg4_helper.zip from this post?

Yes, in the browser it shows correctly

Yes, I’m using a rocg4_helper.zip sample project.

can you set breakpoint in TROTransportChannel.RetrieveRODL (uROTransportChannel.pas) at XmltoRodl := TXMLToRODL.Create(nil); line and evaluate content of resp in debugger?
this is Binary so you can see content with something like PAnsiChar(Binary(resp).Memory)

the result of PAnsiChar(Binary(resp).Memory) is ‘RO107’

weird, this is signature of TROBinMessage


Edit. can you launch your server in debug mode and set breakpoint at MainProcessMessage method (uROServer.pas) at case aRequestStream.Size of line? at requesting RODL in rocg4_helper it should select MetadataRequestIDLength case

Is ServeRodl turned off, maybe?

Hi

I did upgrade to RO 9.7.115.1441 but did not have the changes logged as bugs://81715 and
bugs://81427

I have not yet been able to update my project for a new version of RO.

Please, I need these changes to continue trying to solve my problem.

Regards.

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.