Class to AppServer

Posted by bart.syryn on 22-Dec-2015 04:01

Hi, OE11.3 SP03 I'm trying to learn working with classes in OE. I've read some documents and watched videos. It seems that it isn't possible to pass a class as a parameter to an AppServer (error 13224). Now we send some parameters to the AppServer but I was hoping changing this by just send a class. Is it correct that this isn't possible ? And how can I accomplish the same behaviour or do I need to stick with just sending parameters ? Kind regards Bart S.

All Replies

Posted by Mike Fechner on 22-Dec-2015 04:13

Is OpenEdge 11.4 (or newer) an option? Object serialization was added to the ABL as part of that release.

In the past, we have used our own JSON Serialization implementation, that allowed us to send ABL classes as JSON strings and deserialize them:

github.com/.../ListsAndEnumSamples

confluence.consultingwerkcloud.com/.../viewpage.action

Posted by bart.syryn on 22-Dec-2015 07:17

Hmm, upgrading OpenEdge 11.4 is not an option at this moment. At this point, passing a class to the appserver would be the only reason to upgrade ....

I'll have a look in your examples, I hope I can get around it with your suggestion.

Thanks for replying !

Posted by bart.syryn on 22-Dec-2015 08:55

Hi Mike,

Looked into your supplied examples but I really can't figure out how you place the class into a longchar to pass it to the appserver and how to read that longchar at the appserver side ....

Till a certain point I understand what you do, but then you've lost me ....

Posted by Mike Fechner on 22-Dec-2015 09:27

github.com/.../serialize-customer.p

serializes an object into lcSerialization.

github.com/.../deserialize-customer.p

deserializes from lcSerialization into an object.

github.com/.../Customer.cls

is the sample Customer object.

Posted by bart.syryn on 22-Dec-2015 11:16

Thanks, but I think that I know the reason why I didn't got it.

In serialize-customer.p you have the following statement:

lcSerialization = oCustomer:Serialize() .

But from where comes the serialize() ?  I'm on OE11.3, is it possible that this isn't working in OE11.3 ?

Kind regards,

Bart S.

Posted by Mike Fechner on 22-Dec-2015 11:24

Please have a look at the Customer.cls file.
 
The JSON Serializable class needs to inherit from Consultingwerk.JsonSerializable and properties must be defined using the include file. The property will be defined as a true ABL property – but the Include file defines a &scoped-define list that we need to know the available / serializable properties – as 11.3 is lacking any reflection capabilities.
Von: bart.syryn [mailto:bounce-bartsyryn@community.progress.com]
Gesendet: Dienstag, 22. Dezember 2015 18:18
An: TU.OE.Development@community.progress.com
Betreff: RE: [Technical Users - OE Development] Class to AppServer
 
Update from Progress Community
 

Thanks, but I think that I know the reason why I didn't got it.

In serialize-customer.p you have the following statement:

lcSerialization = oCustomer:Serialize() .

But from where comes the serialize() ?  I'm on OE11.3, is it possible that this isn't working in OE11.3 ?

Kind regards,

Bart S.

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

 

Posted by bart.syryn on 23-Dec-2015 07:29

Hi Mike,

Thanks for you patience.  The last two days I've been trying to get this work, but didn't succeed. Seems like a lot of overhead to just get some parameters to the appserver. I was hoping to be able to pass the class, but in 11.3 it isn't possible.

I'll think I will use a temp-table and do a 'WRITE-JSON' and 'READ-JSON' and then pass the Longchar.  Maybe not the most elegant way but I'll have to wait for 11.4 > ...

Many thanks and kind regards,

Bart S.

This thread is closed