.netapache-flexweborb

WebOrb - Serializing an object as a string


We have an Adobe Flex client talking to a .NET server using WebORB. Simplifying things, on the .NET side of things we have a struct that wraps a ulong like this:

public struct MyStruct
{
    private ulong _val;

    public override string ToString()
    {
        return _val.ToString("x16");
    }

    // Parse method
}

And a class:

public class MyClass
{
    public MyStruct Info { get; set; }
}

I want the Flex client to treat MyStruct as a string. So that for the following server method:

public void DoStuff(int i, MyClass b);

It can call it as (C# here as I don't know Flex)

MyClass c = new MyClass();
c.Info = "1234567890ABCDEF"
DoStuff(1, c)

I've tried playing with custom WebORB serializers, but the documentation is a bit scarce. Is this possible? If so how?

I think I can work out how to serialize it, but not the other way. Do I need to write a Custom Serializer on the the Flex end as well?


Solution

  • With the release of WebORB for .NET 4.0 came new documentation. Please visit:

    http://www.themidnightcoders.com/fileadmin/docs/dotnet/v4/guide/index.html?serializationoverview.htm

    This section of the documentation covers serialization and you can drill down to more detailed information on custom serialization.

    Hope this helps you!

    Cheers, Kathleen