Linkage to rodl file lost when using runtime packages

Hi,

We have migrated from Delphi7 do XE7 and we are facing a problem with the services built with remobjects.
When I run the server address in the browser I get the message “Resource RODL file not found”

I have done some investigating, created new projects, checked whats different between them and our project (because we also had to update the REMObjects component), well all of that took lots of time …

Now I am there that I found out that when I add our runtime packages to the project I get that error with the missing rodl file. The moment I remove all of the runtime packages from the project, buld the project and deploy it, everything works fine and I can read the wsdl (and all the attached services).

So does anybody has any idea what the reason for this could be or what I can do ?

Edit: To be more clear. The error occurs when I set the “Link with runtime Packages” checkbox inside of the project settings

THanks

I can recommend to convert your server to Code-First based servers.
Code-First based servers have no such problem

Hi,

thanks for the input. For the first small test it seems to work with code first.

If I want to conver my RODL based service to code first, whats the best approach? Create a new project and just copy everything or is there a way to make my project code first ?

Regards
semir

you can use our wizard.
pls see the Converting a Server to Code-First article for more details

I did what you suggested. After I hit convert to Code First I got the file myservice_RODLTypes. The problem is now with collections from my service. Everywhere inside of myService_RODLTypes i have stuff like that:

`jxsGegnerTyp = class(jxsPersonenDatenTyp)
 private
    fDrittschuldner: jxsDrittschuldnerArrayTyp;
    function GetDrittschuldner: jxsDrittschuldnerArrayTyp;
    protected
      property int_Drittschuldner: jxsDrittschuldnerArrayTyp read fDrittschuldner;
    published
   [RODocumentation('Deutsch: Liste der Drittschuldner  English: array of ganeshees')]
      property Drittschuldner: jxsDrittschuldnerArrayTyp read GetDrittschuldner write fDrittschuldner;
   end;

  jxsGegnerTypCollection = class(TROCollection<jxsGegnerTyp>);` //This line throws error

And the TROCollection line throws an error for every of my collections. I read the following in your description: …although Arrays defined in RODL don’t really reflect in generated code

What does that mean in particular, do I have to create the colletions on my own ?

regards

EDIT: Obviously I got it wrong. The lines with the collections where (I guess) just randomly selected. When I comment the collection lines out, I still get the same errors in the generated RODLTypes file. Here you can have a look: Screen.

Here is the generated RODLTypes File

Maybe I need to set smt else in the project ?

can you attach your .rodl file, pls? it can be found in __Backup subfolder

I have solved the issue with those errors. The types that had a parent but no own properties where not converted properly. For example this one:

[RODocumentation('Deutsch: Typ des Drittschuldners; geerbt von jxsPersonenDatenTyp  English: Type of garnishee;      
inherited from jxsPersonenDatenTyp')]
jxsDrittschuldnerTyp = class(jxsPersonenDatenTyp)

This is how it was when converted. And I had lots of classes like that (thats why i got lots of errors). I had to change it to:

[RODocumentation('Deutsch: Typ des Drittschuldners; geerbt von jxsPersonenDatenTyp  English: Type of garnishee;      
inherited from jxsPersonenDatenTyp')]
jxsDrittschuldnerTyp = class(jxsPersonenDatenTyp)
private
published
end;

and then I was able to complie (so the private, published and end; tags where not being added automatically).

I have run my service and indeed now its working even when I add my package, or at least I can access the wsdl.

Then i decieded to test it with my C# client, where I am stuck with 2 errors for now.
First one is also related to descending types. For example jximmobilieVollstaendig is a descendant from jxImmobilie. When I call my function (ImmobilieOeffnen) where I read jxImmobilieVollstaendig (that was working fine while using the RODL based service), I get the error that ImmobilieNr was expected but got TitelbildUrl (ImmobilieNr is the first child of jxImmobilie and TitelbildUrl the first child of jximmobilieVollstaendig). Then I decided to let jximmobilieVollstaendig inherit from complex type (instead of jximmobilie) and added all the missing parameters from jximmobilie and it was working fine (of course just that was just for testing purposes bcz I have lots of descending classes and I cant do that for all of them), I was able to read the data from my client. But I need it to work with descending from my classes too not just from complex type.

My Second error is when i try to call the function ImmobilieSpeichernAsync. The parameter should be jxImmobilieVollstaendig, but when I pass the parameter I get the error: "Error reading parameter immobilie: Unexpected class found in stream; class \"jxImmobilieVollstaendig\" does not descend from \"jxImmobilieVollstaendig\".". And for this one I still dont have a fix

Files:

RODL
New RODLTypes (after customized)
Service Implementation (ImmobilieSpeichern, ImmobilieOeffnen)

Regards

Thanks, logged as bugs://75863

bugs://75863 got closed with status fixed.

this was fixed as #75863.
workaround: update ..\RemObjects SDK for Delphi\Source\IDE\uROCodeFirstConversionWizard.pas as

procedure TROConversionWizard.GenerateStructInterface(Str: TStringList; aLibrary: TRODLLibrary; aStruct: TRODLStruct);
..
    end;
    //    Str.Add('  end;');  <<<<<<<<<<< deleted
  end;
  Str.Add('  end;'); // <<<<<<<<<< added
  Str.Add('');
  Str.Add(Format('  %sCollection = class(TROCollection<%0:s>);', [aStruct.Name]));
end;

and recompile correspondent RemObjects_Server_IDE package

Is that going to solve the other 2 problems I am facing too ?

Regards

that fix solves the problem with empty structs only

A ok. As I said, I fixed that already on my own …

Thanks, anyway.

But you have any idea on that other 2 problems ?

I tried any of my complex types, and if I send any of them to the service, I get the same error message

Regards
Semir.

But you have any idea on that other 2 problems ?

I’m working with it

hmm, I can’t reproduce any problem with your server (code-first version) and delphi client via SOAPMessage

can you specify what version of ROD you are using?
can you reproduce these issues with delphi client that calls ImmobilieOeffnen method?

I created a new code first project with a client, to see how to create the client, but even there I have some struggle. I have set up the test server and I can access him through the browser: Server

Inside of the (automatically created) client it says:

 The unit FullCodeFirstLibrary_Intf.pas will be generated by the RemObjects preprocessor the first time you
  compile your server application. Make sure to do that before trying to compile the client.

But I didnt get such unit, and I am not able to compile the client code

Regards
Semir

pls connect to server as described in Connecting to a Remoting SDK Server article.

this was already fixed in beta so wizard generates .RemoteRODL file automatically.

note: according to your screenshot, you are using Bin message instead of Soap. if you want to use SOAP message, pls specify soap in url like http://127.0.0.1:10001/soap

Ok, I managed to run that simple example.
But before trying it with my own project i realised that there is no point in doing it within delphi bcz I need it to work with C#.
For that purpose I used my freshly created project and tried to send a complex type with C# and that worked like a charm. So i guess it must be smt related to the converting . One more thing I will try, to be sure about that, I will use a very complex object from my project implement it inside of the test service and see if I can send it with C#. If that works then it must for sure be smt related to converting from RODL to Code First.

One more question, are those RODL based services considered deprecated, and you want to move your customers to Code First or was that just an advice for my situation ?

Regards

Just for the information, I found the cause of the problem

 "Error reading parameter immobilie: Unexpected class found in stream; class \"jxImmobilieVollstaendig\" does not      
  descend from \"jxImmobilieVollstaendig\".".

Even though the _Intf file was removed from the project, a reference to it remained inside of one file (sadly enough the name of the file was Test and it cost me almost a day to figure it out). After removing the reference everything is working as expected.

Just as a suggestion, maybe in your tutorial you should point more out to search explicitly for remaining refeences to the Intf and Invk files when converting from RODL to Code First

What still remains is the problem with extended classes. I can reproduce that with a newly created Code First project.
I add the following code:

Types:

type
  TMyStruct = class(TROComplexType)
  private
    fA: Integer;
    fB: string;
  published
    property A :Integer read fA write fA;
    property B :string read fB write fB;

  end;


type
  TMyStructExtended = class(TMyStruct)
  private
    fC: Integer;
    fD: string;
  published
    property C :Integer read fC write fC;
    property D :string read fD write fD;

  end;

Service;

 TFullCodeFirst = class(TRORemoteDataModule)
   private
   public
    [ROServiceMethod]
    function NewMethod () : TMyStructExtended;
 end;

When I call NewMethod from the client I get this message:

Error while deserializing parameter http://tempuri.org/:Result. Error at line 1 Position 555, "Element" "C" from the namespace "http://tempuri.org/" is not expected. The Element "A" is expected

With a Delphi client it works, but when using Visual Studio I get that error

Thanks for the support

RODL based services won’t be considered as deprecated so it was an advice for your situation.

we will review this case