axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sampige, Srinivas" <SSamp...@DIRECTV.com>
Subject java object serialization in AXIS1 ..
Date Mon, 12 Mar 2007 22:41:39 GMT
I am serializing an object (which was generated as part of the client
classes) using the following code -

 

    public static String getXML(ScheduleMessage message)

    {

      try

      {

            javax.xml.namespace.QName qName = new
javax.xml.namespace.QName("http://tempuri.org/", "ScheduleMessage");

            BeanSerializer beanSerializer = new
org.apache.axis.encoding.ser.BeanSerializer(com.directv.dtss.itx.client.
ScheduleMessage.class, qName, typeDesc);    

            StringWriter w = new StringWriter();

            SerializationContext ctx = new SerializationContext(w);

            beanSerializer.serialize(qName, null, message, ctx);

            StringBuffer b = w.getBuffer();

            System.out.print(b.toString());

            

            return b.toString();

      }

      catch(Exception e)

      {

            e.printStackTrace();

            return null;

      }

    }

 

Question - In the generated type below how do I get rid of the  xsi:type
and xmlns:xsi  when the XML gets generated? I want the XML to  be clean
..something like <StartDate>2007-03-12T21:49:04.351Z</StartDate> ...etc.
instead of what is generated currently -

 

<?xml version="1.0" encoding="UTF-8"?><ns1:ScheduleMessage
xmlns:ns1="http://tempuri.org/"><Events xsi:type="ns1:ScheduleEvent"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><EventId
xsi:type="xsd:string"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">eventid</EventId><StartDate
xsi:type="xsd:dateTime"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">2007-03-12T21:49:04.351Z</S
tartDate><StartTime xsi:type="xsd:string"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">10:00:00</StartTime><StartM
ode xsi:type="ns1:EventStartType">Manual</StartMode><Source
xsi:type="xsd:string"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">source</Source>

 

Any help is greatly appreciated.

 

Regards

Srinivas

 


Mime
View raw message