You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Jerry Thomas <jj...@flash.net> on 2002/07/08 17:52:10 UTC
how to programmatically add type mappings in Axis?
As part of registering the type mapping for a top level class, I would like to add code to programmatically add type mappings for subordinate classes within my serializer or serializer factory class?
I'm assuming that if I can get a reference to the active AxisServer, I can get the type mapping registry and add my type mappings. So how do I get a reference to the active AxisServer?
Thanks, Jerry
RE: how to programmatically add type mappings in Axis?
Posted by Jerry Thomas <jj...@flash.net>.
Thanks for your response. I may be wrong, but it looks like this call will
work from a client (i.e. you are registering type mappings for a call).
What I'd like to do however is programmatically register type mappings on
the server.
Thanks, Jerry
-----Original Message-----
From: santhosh [mailto:santhosh.kumar@cominsights.com]
Sent: Monday, July 08, 2002 10:42 PM
To: axis-user@xml.apache.org
Subject: Re: how to programmatically add type mappings in Axis?
Jerry,
Here is the code fragement for doing Bean Serialization/Deserialization.
For other kind of Serialization/Deserialization, refer to the API
documentation given by AXIS. (org.apache.axis.encoding.ser package).
import org.apache.axis.encoding.ser.BeanSerializerFactory;
import org.apache.axis.encoding.ser.BeanDeserializerFactory;
import com.google.soap.search.GoogleSearchResult;
//Creating Bean Serializer/Deserializer factory
BeanSerializerFactory bsf1 = new
BeanSerializerFactory(GoogleSearchResult.class, new
QName("urn:GoogleSearch", "GoogleSearchResult"));
BeanDeserializerFactory bdf1 = new
BeanDeserializerFactory(GoogleSearchResult.class, new
QName("urn:GoogleSearch", "GoogleSearchResult"));
//Mapping the Return type objects with XML
call.registerTypeMapping(GoogleSearchResult.class, new
QName("urn:GoogleSearch", "GoogleSearchResult"),bsf1, bdf1);
Regards,
Santhosh
----- Original Message -----
From: Jerry Thomas
To: Apache Axis Users Group
Sent: Monday, July 08, 2002 9:22 PM
Subject: how to programmatically add type mappings in Axis?
As part of registering the type mapping for a top level class, I would
like to add code to programmatically add type mappings for subordinate
classes within my serializer or serializer factory class?
I'm assuming that if I can get a reference to the active AxisServer, I
can get the type mapping registry and add my type mappings. So how do I get
a reference to the active AxisServer?
Thanks, Jerry
Re: how to programmatically add type mappings in Axis?
Posted by santhosh <sa...@cominsights.com>.
Jerry,
Here is the code fragement for doing Bean Serialization/Deserialization. For other kind of Serialization/Deserialization, refer to the API documentation given by AXIS. (org.apache.axis.encoding.ser package).
import org.apache.axis.encoding.ser.BeanSerializerFactory;
import org.apache.axis.encoding.ser.BeanDeserializerFactory;
import com.google.soap.search.GoogleSearchResult;
//Creating Bean Serializer/Deserializer factory
BeanSerializerFactory bsf1 = new BeanSerializerFactory(GoogleSearchResult.class, new QName("urn:GoogleSearch", "GoogleSearchResult"));
BeanDeserializerFactory bdf1 = new BeanDeserializerFactory(GoogleSearchResult.class, new QName("urn:GoogleSearch", "GoogleSearchResult"));
//Mapping the Return type objects with XML
call.registerTypeMapping(GoogleSearchResult.class, new QName("urn:GoogleSearch", "GoogleSearchResult"),bsf1, bdf1);
Regards,
Santhosh
----- Original Message -----
From: Jerry Thomas
To: Apache Axis Users Group
Sent: Monday, July 08, 2002 9:22 PM
Subject: how to programmatically add type mappings in Axis?
As part of registering the type mapping for a top level class, I would like to add code to programmatically add type mappings for subordinate classes within my serializer or serializer factory class?
I'm assuming that if I can get a reference to the active AxisServer, I can get the type mapping registry and add my type mappings. So how do I get a reference to the active AxisServer?
Thanks, Jerry