Reputation: 1420
Using axis2's wsdl2java tool and a third-party wsdl I have generated service stub and supporting classes (data holders). Since there is a need to do post-processing of loaded data from a service, there is a need to serialize one of the data holder objects.
1) is there a standard axis2 tool / approach that can be used for the purpose?
2) since the data holder class does not implement Serializable interface what would be the easiest way of serializing the object into xml format with the ability to restore the original object?
Data binding option was used (-d jaxbri) and each field of the class in question is annotated with @XmlElement tag, e.g.:
@XmlElement(name = "ID", required = true)
protected String id;
Upvotes: 0
Views: 1665
Reputation: 1420
Ok, here is how I solved it:
on the receiving end:
ASerializable aSerializable; A a; aSerializable= (ASerializable)in.readObject(); a.setID((String)aSerializable.getID().getValue());
it still looks like extra work for the pre-annotated class serialization, but better than serializing into some text format and manual type checking during deserialization.
Upvotes: 0