Sergey, I must admit my question was badly asked. Actually I am wondering how I could use restful web-services if clients only get an XML representation of the Object they request ? I am not using SOAP, nor any WSDL description.
I expected to be able to get a kind of "stub" object on client side (may be thanks to a sort of "unmarshalling" of this XML I get from the server) The CXF Jaxrs demo piece of code I have shown in my previous mail only shows how to display an XML representation of Customer with Id 123 which is fine. But in my case, I would like to manipulate an actual Customer stub instance, so that I can call methods on it and do interesting things with what the server has sent to me. I might be confused because so far I was using Hessian (http://hessian.caucho.com/) where their binary protocol allow a web service client to get an actual instance of the object they request. I might be totally wrong about Restful web services, and I realize that it may totally absurd to have the same behaviour with REST as what I had with Hessian. My question is more general : How do Clients of Restful webservices get a concrete use of the XML content they receive from the server ? (I guess people just don't print out this XML on console :) but I suppose they have to parse it/ unmarshall it in some way ?) PS :I don't know about WADL , so please excuse my ignorance. Thanks for helping anyway ;) Eric On Dec 19, 2007 11:54 AM, Sergey Beryozkin <[EMAIL PROTECTED]> wrote: > Hi > > I'm wondering, are you actually asking for a code generation be done on a > client side with the help of a description language like WSDL 2.0 or WADL ? > > Cheers, Sergey > > > > ----- Original Message ----- > From: "Eric Le Goff" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Tuesday, December 18, 2007 4:34 PM > Subject: JAXB Unmarshalling > > > >I am going on playing with the restful_jaxrs sample demo > > > > > > In the Client.java there are these lines > > > > ... > > URL url = new URL("http://localhost:9000/customerservice/customers/123"); > > InputStream in = url.openStream(); > > System.out.println(getStringFromInputStream(in)); > > .... > > > > > > What if I did not want to display the XML content (ie the XML > > representation of customer whose Id is 123) > > But rather I would like to get the actual instance of Customer with id is > > 123 > > > > Is there some Unmarshalling method to do that , something like > > > > ... > > URL url = new URL("http://localhost:9000/customerservice/customers/123"); > > InputStream in = url.openStream(); > > > > // Hypothetic code > > Customer customer = (Customer) getObjectFromInputStream(in); > > ... > > > > How would I implement this > > > > Object getObjectFromInputStream(InputStream in) > > > > method ? > > > > I guess I would have to get a JaxbContext before I can get an Unmarshaller ? > > > > > > Thanks for your help > > > > Eric > > > > > > > > > > -- > > Eric Le Goff > > ---------------------------- > IONA Technologies PLC (registered in Ireland) > Registered Number: 171387 > Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland > -- Eric Le Goff
