Sure.!!
We used it when we need to consume Restful services.
Ex:
URL url = new URL(Url2);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
if (conn.getResponseCode() != 200) {
throw new RuntimeException("Failed : HTTP error code : "
+ conn.getResponseCode());
}
BufferedReader br = new BufferedReader(new InputStreamReader(
(conn.getInputStream())));
QNameMap qmap = new QNameMap();
QName qname = new QName("http://cdae.uci.cu/servicios/", "Usuarios");
qmap.registerMapping(qname, Usuarios.class);
StaxDriver staxDriver = new StaxDriver(qmap);
XStream xstream = new XStream(staxDriver);
xstream.alias("Usuarios", Usuarios.class);
xstream.alias("Usuario", Usuario.class);
ObjectInputStream in = xstream.createObjectInputStream(br);
Usuario user =null;
while ((user = (Usuario)in.readObject())!=null)
{
System.out.println(user.getNombre());
}
Saludos,
Ing. Jorge Infante Osorio.
J´Dpto Soluciones SOA.
CDAE.
Fac. 5.
UCI.
De: [email protected] [mailto:[email protected]] En nombre de Ishan
Somasiri
Enviado el: jueves, 14 de junio de 2012 7:05
Para: [email protected]
Asunto: [Dev] XStream - a simple library to serialize Java objects to XML
and back again.
<http://xstream.codehaus.org/> http://xstream.codehaus.org/
It's cool and very useful..!
10mo. ANIVERSARIO DE LA CREACION DE LA UNIVERSIDAD DE LAS CIENCIAS
INFORMATICAS...
CONECTADOS AL FUTURO, CONECTADOS A LA REVOLUCION
http://www.uci.cu
http://www.facebook.com/universidad.uci
http://www.flickr.com/photos/universidad_uci
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev