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 Sharon Whipple <sh...@hotmail.com> on 2007/05/18 23:12:14 UTC
axis1 code on axis2
i have the next serializetion code from axis1
will it work on axis2?
is there any other way to pass / serialize Objects ?
Thank you
Sharon
public Object deserialize(SOAPElement ele) {
String str = "";
for( Iterator i = ele.getChildElements(); i.hasNext();) {
Object obj = i.next();
if( obj instanceof Text ) {
str += ( ((Text)obj).getValue() );
}
}
return new MyDate(str);
}
/**
* The qname parameter must be used to create the top level element.
*/
public SOAPElement serialize(QName qname, Object obj) {
SOAPElement xml = null;
try {
xml = soapFactory.createElement(
qname.getLocalPart(),
qname.getPrefix(),
qname.getNamespaceURI());
xml.addTextNode( ((MyDate)obj).getString() );
} catch (SOAPException e) {
e.printStackTrace();
}
return xml;
}
--
View this message in context: http://www.nabble.com/axis1-code-on-axis2-tf3780170.html#a10690433
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org