axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wolfgang Vullhorst" <wvullho...@s-und-n.de>
Subject Retrieve result of a serialization as String or Document?
Date Fri, 05 Sep 2003 08:46:20 GMT
Hi,
  is there a way to call the serialization of a bean object "manually" to
retrieve the result in a String?

I tried the following:

		QName qn = new QName("www.abc.de/analysis");
		BeanSerializer bs = new BeanSerializer(AnalysisRequest.class, qn);
		StringWriter sw = new StringWriter();
		SerializationContextImpl sci = new SerializationContextImpl(sw, new
MessageContext(new AxisClient()));
		try
		{
			bs.serialize(new QName("AnalysisRequest"), new AttributesImpl(), req,
sci);
		}
		catch (IOException e)
		{
			e.printStackTrace();
		}
		System.out.println(sw.getBuffer().toString());

This works fine for the class "AnalysisRequest" (although I don't have a
good feeling to create a new AxisClient).

I now have the following problem:
AnalysisRequest contains a Vector of AnalysisRequestElement objects.
When using the Service/Call methods to pass an AnalysisRequest object to a
Webservice I register 2 type mappings (for AnalysisRequest and for
AnalysisRequestElement).

Is there a better way to serialize my object(s) to a String (or Document)?
Is there a way to adapt the type mapping strategy to my own method?

Thanks in advance,
  Wolfgang Vullhorst


Mime
View raw message