Insights on Software Development and Architecture

ErionPC's weblog on software development

Glassfish and XML Serialization

Having worked with the .NET frameworks in Visual Studio, whenever I implemented an ASPNET web service I was used to return generalized collections of my business objects which were declared in nested layers and I never had any problems because the returned values would always be xml-serializations of my classes. However, having to work with GlassFish now I found that serialization isn’t that immediate. After days of looking for documentation on this issue, I discovered that Glassfish doesn’t serialize your objects unless they respect the java-beans structure (private fields, public getters and setters in CamelCase and a no-parameter constructor) and (obviously) they need to implement the java.io.serializable interface. I also found that nested classes can’t be serialized (but maybe I’m wrong).

I’ve written a more recent post on this topic. Click here to view it.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: