Jersey 1.18 client with jaxb -


I am trying to use the Jersey 1.18 client to get XML data from the rest of the web web service and then it I am doing unexpected use of jackbys. The problem is that I do not know how to forward the data directly to jerseys from jersey and the code looks a little frightening.

  Client Client = Client.Create (); WebResource webResource = client.resource ("http://something.com"); Client response page response = webResource.accept ("App / Jason") .get (ClientResponse.class); If (response.getStatus ()! = 200) {New Runtime Exception ("Failed: HTTP Error Code:" + response.getStatus ()); } String output = response. Gate entity (string class); JAXBContext jaxbContext = JAXBContext.newInstance (person class); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller (); StringReader Reader = new stringreader (output); Person person = (person) unmarshaller.unmarshal (reader);  

Is there another great way to do this? I'm using Jersey 1.18 because the latest version pulls a lot! Dependence and I want to actually lighten my "customer" ..


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -