users@jersey.java.net

[Jersey] Re: Digest for list users_at_jersey.java.net

From: Simon Roberts <simon_at_dancingcloudphotography.com>
Date: Mon, 6 Oct 2014 09:15:09 -0600

Does your value object also have a method called date_add?


On Sun, Oct 5, 2014 at 9:05 PM, <users-request_at_jersey.java.net> wrote:

> Table of contents:
>
> 1. [Jersey] Please help, problem mapping web service classes pojo jersey -
> Alberto Marqués <zerouno.dev_at_gmail.com>
>
>
>
> ---------- Forwarded message ----------
> From: "Alberto Marqués" <zerouno.dev_at_gmail.com>
> To: users_at_jersey.java.net
> Cc:
> Date: Sun, 5 Oct 2014 18:34:24 +0200
> Subject: [Jersey] Please help, problem mapping web service classes pojo
> jersey
> Can anyone help :(
>
> When running from java web service returns me an xml but map it on pojo class
> or vo class. I have this exception
>
> Class has two properties of the same name "date_add"
> this problem is related to the following location:
> at public java.lang.String
> distrito2presta.Model.Pedido.getDate_add()
> at distrito2presta.Model.Pedido
> at distrito2presta.Model.Pedido
> distrito2presta.Model.PrestaPedido.pedido
> at distrito2presta.Model.PrestaPedido
> this problem is related to the following location:
> at public java.lang.String distrito2presta.Model.Pedido.date_add
> at distrito2presta.Model.Pedido
> at distrito2presta.Model.Pedido
> distrito2presta.Model.PrestaPedido.pedido
> at distrito2presta.Model.PrestaPedido
>
> Client Java
> ================
>
> ClientResponse response =
> service.path(m.Path()).path(m.Model().id.toString()).type(MediaType.TEXT_XML).get(ClientResponse.class);
>
> if (sucess(response.getStatus())){
> Sincro.LOG.info(response.toString());
> Model model = null;
> PrestaPedido oPrestaPedido = null;
> try{
> oPrestaPedido = (PrestaPedido)
> response.getEntity(m.getClass());
> }catch(Exception e){
> System.out.println("Error al
> getEntity::"+e.getMessage());
> }
> return model;
> //return m.Model();
>
>
> XML return
> ===========
> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
> <order>
> <id>
> <![CDATA[ 1 ]]>
> </id>
> <date_add>
> <![CDATA[ 2014-08-22 16:26:15 ]]>
> </date_add>
> </order>
> </prestashop>
>
> Class VO
> =============
> import org.eclipse.persistence.oxm.
> annotations.XmlCDATA;
>
> import javax.xml.bind.annotation.XmlRootElement;
>
> @XmlRootElement(name="prestashop")
> public class Pedido {
>
> @XmlCDATA public Integer id=null;
> @XmlCDATA public String date_add=null; //Fecha
> creación
>
> }
>
>
> End of digest for list users_at_jersey.java.net - Mon, 06 Oct 2014
>
>


-- 
Simon Roberts
Certified Professional Photographer
http://dancingcloudphotography.com
(303) 249 3613