Passing a case class between Scala and Flex using BlazeDS

When trying to pass a “case class” from Scala to Flex, the results on the Flex side are a regular object instead of UINamespace. Changing the case class to a regular Java class, and it does the right thing.

The case class is as follows:

package com.scala.vo
case class UINamespace (@BeanProperty var name : String,
                        @BeanProperty var version : String,
                        @BeanProperty var parameters : java.util.List[String]) {
   def this() = this("", "", null)
}

Flex Side:

[RemoteClass(alias="com.scala.vo.UINamespace")]
public class UINamespace
{
    public var name : String;
    public var version : String;
    public var parameters : ArrayCollection;
}

Has anyone been able to solve this?

[Edited] Changed the null value for the result of a regular object.

+3
source share
1 answer

I tried it again today and it worked. I am not sure what was the exact reason why he did not work asking the question.

I will leave the question here, therefore, if others have problems with the case class, at least they will know that it should work.

0
source

Source: https://habr.com/ru/post/1796649/


All Articles