Generated RODL doesn't pass validation. Check Details property for detailed errors list

I have Service A
And Service B

From the generated _Intf file of library A, I have a ComplexType DateTime64, which now I can get from library A.

But, if Library B has a service method, that returns a DateTime64 (referencing the _Intf). I get a “Generated RODL doesn’t pass validation. Check Details property for detailed errors list” exception.

Please note, the exception goes away if I comment the ReadComplex, and WriteComplex methods from the function. But then I get an exception when I serialize / deserialize.

Am I doing something here that I shouldn’t be?

    [System.Serializable()]
    [RemObjects.SDK.Remotable(ActivatorClass=typeof(DateTime64_Activator))]
    [System.Reflection.ObfuscationAttribute(Exclude=true)]
    public partial class DateTime64 : RemObjects.SDK.Types.ComplexType {
        
        private long ___Ticks;
        
        public virtual long Ticks {
            get {
                return ___Ticks;
            }
            set {
                ___Ticks = value;
                this.TriggerPropertyChanged("Ticks");
            }
        }
        
        public override void ReadComplex(RemObjects.SDK.Serializer serializer) {
            if (serializer.RecordStrictOrder) {
                this.Ticks = serializer.ReadInt64("Ticks");
            }
            else {
                this.Ticks = serializer.ReadInt64("Ticks");
            }
        }
        
        public override void WriteComplex(RemObjects.SDK.Serializer serializer) {
            if (serializer.RecordStrictOrder) {
                serializer.WriteInt64("Ticks", this.Ticks);
            }
            else {
                serializer.WriteInt64("Ticks", this.Ticks);
            }
        }
    }
RemObjects.SDK.Exceptions.RodlValidationException: Generated RODL doesn't pass validation. Check Details property for detailed errors list
   at RemObjects.SDK.Server.ConfigurationWrapper.TryLoad(Type[] types, Object[] parameters)
   at RemObjects.SDK.Server.ConfigurationWrapper.Load(String applicationName, String rodlNamespace)
   at RemObjects.SDK.Server.ConfigurationLoader.LoadConfiguration(Type type)
   at RemObjects.SDK.Server.ConfigurationLoader.LoadConfiguration()
   at RemObjects.SDK.Server.ConfigurationLoader.Load()
   at RemObjects.SDK.Server.ApplicationServer.LoadApplicationServerConfiguration()
   at RemObjects.SDK.Server.ApplicationServer.RunAsConsoleApplication()
   at RemObjects.SDK.Server.ApplicationServer.RunConsoleApplication()
   at RemObjects.SDK.Server.ApplicationServer.RunOnNetFX()
   at RemObjects.SDK.Server.ApplicationServer.Run(String[] arguments)
   at LynxBotService.LynxWebServer.Start(Boolean RunAsService) in D:\adato_webservice\MicroServices\LynxBotService\LynxWebServer.cs:line 71
   at LynxBotService.Program.Main(String[] args) in D:\adato_webservice\MicroServices\LynxBotService\Program.cs:line 16

Here is an example project, I have the DateTime64 from a library, and its breaking Generated RODL doesn’t pass validation. Check Details property for detailed errors list.
In the details list I see only:
LynxWebService.DashboardService (Operations list is empty)

ConsoleApp1.zip (2.6 KB)

Hi,

as expected. you haven’t added [ServiceMethod] attribute so validation doesn’t find any “public” method:

    [RemObjects.SDK.Server.ServiceMethod]
    public void ServiceMethodExample1(DateTime64 dateTime64)

also you can declare DateTime64 as

public partial class DateTime64 : RemObjects.SDK.Types.ComplexType {
    public long Ticks;        
}

it will remove another error at validation.


I can suggest to read Defining Code-First services (.NET) article.

Sorry, that was a bad example project on my part (I indeed forgot to add the ServiceMethod attribute in this test case, but in my real case in my real project its there)

Indeed the second error in validation is the one I’m interested in.
In the example project it shows up as this (If I add [ServiceMethod]):
I get the same validation error, with this in the details:

ServiceMethodExample1.dateTime64 (Element DataType is not valid. DateTime64)

My question is that I am generating an interface using the remobjects rodl, which is producing many classes, DateTime64 is just one of them.

Then, I have one type of client, that uses this interface to talk to my main server. Who also would like to serve these objects as a server itself. Do I have to redefine them, because Ideally, I will simply use the objects I’m importing (getting back by calling the main service, then returning them using ServiceMethods)

I will indeed follow the link and see if I learn something about this.
Modifying it to this would indeed work, but then I would have todo this for all types I’d like to get from the Interface file, and I will have to redo that every time I re-generate the interface file.

public partial class DateTime64 : RemObjects.SDK.Types.ComplexType {
    public long Ticks;        
}

Hi,

if you want to use types from autogenerated _Intf, you should include that .RODL as Embedded Resource into server project, otherwise types from _Intf won’t be found.

I’m not sure what you mean, it is in the embedded resources of the server project (if I understand it correctly). As the class definition is literally just a .cs script. Infact, simply commenting out these two auto generated functions seems to fix it (ReadComplex, WriteComplex) So I think its probably something todo with that? Or is it that those are preventing a redefinition of the Complex Serialization? In my mind, I should have been able to reuse this definition. But maybe I am miss understanding the intended behavior:

[System.Serializable()]
[RemObjects.SDK.Remotable(ActivatorClass=typeof(DateTime64_Activator))]
[System.Reflection.ObfuscationAttribute(Exclude=true)]
public partial class DateTime64 : RemObjects.SDK.Types.ComplexType {
        
    private long ___Ticks;
        
    public virtual long Ticks {
        get {
            return ___Ticks;
        }
        set {
            ___Ticks = value;
            this.TriggerPropertyChanged("Ticks");
        }
    }
        
    // public override void ReadComplex(RemObjects.SDK.Serializer serializer) {
    //     if (serializer.RecordStrictOrder) {
    //         this.Ticks = serializer.ReadInt64("Ticks");
    //     }
    //     else {
    //         this.Ticks = serializer.ReadInt64("Ticks");
    //     }
    // }
    //     
    // public override void WriteComplex(RemObjects.SDK.Serializer serializer) {
    //     if (serializer.RecordStrictOrder) {
    //         serializer.WriteInt64("Ticks", this.Ticks);
    //     }
    //     else {
    //         serializer.WriteInt64("Ticks", this.Ticks);
    //     }
    // }
}

My issue being, is that I want to auto generate my _Intf file, then be able to use it, and update it, without having to remodify it every time.

Hi,

When CodeFirst code detects ComplexType descendant, it checks for ReadComplex & WriteComplex methods in it.

if any of these methods is present, code considers that this type is from embedded .RODL and doesn’t process this type.

if you haven’t embedded .RODL into server-side project, this error will be raised:

ServiceMethodExample1.dateTime64 (Element DataType is not valid. DateTime64)

if you want to use such types w/o modifications just include your .RODL as embedded resource into server-side project.

Great! That worked!

It would be nice if it can not assume this, if no such file is present. But I also assume that I can’t see the full picture.

Thank you for the help!