Parse Json file in MongoDB using Spring Data Java - java

this problem only occurs when I get the data from the database, the application is replacing the _ with . this only happens when I get the record from the database
data in database
[{"nombre": "pablo", "pais(codigo)": "52", "telefono": "", "saldo_total": "10"}, {"nombre": "pablo", "pais(codigo)": "52", "telefono": "", "saldo_total": "10"}]
entity in java code
#EnableMongoRepositories
#Document(collection = "data")
public class DataEntity extends BaseMongoEntity {
#Id
private String id;
#Field(value = "company_id")
private int companyId;
private String name;
private String url;
private List<String> variables;
private List<Object> info;
public DataEntity() {
super();
// TODO Auto-generated constructor stub
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public int getCompanyId() {
return companyId;
}
public void setCompanyId(int companyId) {
this.companyId = companyId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public List<String> getVariables() {
return variables;
}
public void setVariables(List<String> variables) {
this.variables = variables;
}
public List<Object> getInfo() {
return info;
}
public void setInfo(List<Object> info) {
this.info = info;
}
}
query to find the record in database
public DataEntity findById(String id) {
ObjectId idO = new ObjectId(id);
Query query = new Query(Criteria.where("_id").is(idO));
return mongoTemplate.findOne(query, DataEntity.class);
}
image of data obtained in object format
only happens when the record is obtained but not when saving data in the database.

Related

I have multiple OneToMany mappings in a entity. Hibernate loads the first one even without me requesting that object. Is that the expected behaviour?

MedicalEntity:
#Entity
#Table(name="t_med_area")
public class MedicalEntity {
#Id
#GeneratedValue(strategy=GenerationType.IDENTITY)
#Column(name="med_area_id")
private Integer med_area_id;
#Column(name="med_area_cd")
private String area_code;
#Column(name="area_nm")
private String area_description;
#OneToMany(fetch = FetchType.LAZY,mappedBy="medical_area_id")
private List<ProviderEntity> resources;
#OneToMany(fetch = FetchType.LAZY,mappedBy="medAreaId")
private List<FacilityEntity> facility;
public List<ProviderEntity> getResources() {
return resources;
}
public void setResources(List<ProviderEntity> resources) {
this.resources = resources;
}
public List<FacilityEntity> getFacility() {
return facility;
}
public void setFacility(List<FacilityEntity> facility) {
this.facility = facility;
}
public Integer getMed_area_id() {
return med_area_id;
}
public void setMed_area_id(Integer med_area_id) {
this.med_area_id = med_area_id;
}
public String getArea_code() {
return area_code;
}
public void setArea_code(String area_code) {
this.area_code = area_code;
}
public String getArea_description() {
return area_description;
}
public void setArea_description(String area_description) {
this.area_description = area_description;
}
FacilityEntity:
#Entity
#Table(name="t_facility")
public class FacilityEntity implements Serializable{
private static final long serialVersionUID = 1L;
#Id
#GeneratedValue(strategy=GenerationType.IDENTITY)
#Column(name="id")
private Integer id;
#Column(name="facility_id")
private int facilityId;
#Column(name="facility_nm")
private String facilityName;
#Column(name="facility_code")
private String facilityCode;
#OneToMany(fetch = FetchType.LAZY,mappedBy="facility_id")
private List<ProviderEntity> resources;
#ManyToOne(fetch = FetchType.LAZY)
#JoinColumn(name="med_area_id")
private MedicalEntity medAreaId;
#Column(name="insert_dt")
private Date insertDt;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public int getFacilityId() {
return facilityId;
}
public void setFacilityId(int facilityId) {
this.facilityId = facilityId;
}
public String getFacilityName() {
return facilityName;
}
public void setFacilityName(String facilityName) {
this.facilityName = facilityName;
}
public String getFacilityCode() {
return facilityCode;
}
public void setFacilityCode(String facilityCode) {
this.facilityCode = facilityCode;
}
public List<ProviderEntity> getResources() {
return resources;
}
public void setResources(List<ProviderEntity> resources) {
this.resources = resources;
}
public MedicalEntity getMedAreaId() {
return medAreaId;
}
public void setMedAreaId(MedicalEntity medAreaId) {
this.medAreaId = medAreaId;
}
public Date getInsertDt() {
return insertDt;
}
public void setInsertDt(Date insertDt) {
this.insertDt = insertDt;
}
public FacilityEntity(Integer id, String facility_name, String facility_code) {
super();
this.id = id;
this.facilityName = facility_name;
this.facilityCode = facility_code;
}
public FacilityEntity() {
super();
}
}
Provider Entity:
#Entity
#Table(name="t_provider")
public class ProviderEntity implements Serializable {
#Id
#GeneratedValue(strategy=GenerationType.IDENTITY)
#Column(name="provider_id")
private Integer provider_id;
#Column(name="resource_cd")
private String resource_code;
#Column(name="first_nm")
private String first_name;
#Column(name="last_nm")
private String last_name;
#Column(name="middle_nm")
private String middle_name;
#Column(name="title_nm")
private String title;
#Column(name="department_nm")
private String department_name;
#ManyToOne(fetch = FetchType.LAZY)
#JoinColumn(name="home_med_area_id")
private MedicalEntity medical_area_id;
#ManyToOne(fetch = FetchType.LAZY)
#JoinColumn(name="home_facility_id")
private FacilityEntity facility_id;
public Integer getProvider_id() {
return provider_id;
}
public void setProvider_id(Integer provider_id) {
this.provider_id = provider_id;
}
public String getResource_code() {
return resource_code;
}
public void setResource_code(String resource_code) {
this.resource_code = resource_code;
}
public String getFirst_name() {
return first_name;
}
public void setFirst_name(String first_name) {
this.first_name = first_name;
}
public String getLast_name() {
return last_name;
}
public void setLast_name(String last_name) {
this.last_name = last_name;
}
public String getMiddle_name() {
return middle_name;
}
public void setMiddle_name(String middle_name) {
this.middle_name = middle_name;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDepartment_name() {
return department_name;
}
public void setDepartment_name(String department_name) {
this.department_name = department_name;
}
public MedicalEntity getMedical_area_id() {
return medical_area_id;
}
public void setMedical_area_id(MedicalEntity medical_area_id) {
this.medical_area_id = medical_area_id;
}
public FacilityEntity getFacility_id() {
return facility_id;
}
public void setFacility_id(FacilityEntity facility_id) {
this.facility_id = facility_id;
}
public ProviderEntity() {
super();
}
}
Service Layer:
List<MedicalEntity> result=medicalAreaRepository.findAll();
//transforming entity into DTO and setting properties based on UI requirements
for(MedicalEntity medicalEntity:result)
{
MedicalDTO medicalDTO=new MedicalDTO();
medicalDTO.setArea_code(medicalEntity.getArea_code());
medicalDTO.setArea_description(medicalEntity.getArea_description());
medicalDTO.setId(medicalEntity.getMed_area_id());
//System.out.println(medicalEntity.getResources());
medicalResponse.addElementsToList(medicalDTO);
}
When I call hover over my List result, it automatically fires the query to load the facilities.
Logs which are generated:
Hibernate: select medicalent0_.med_area_id as med_area1_1_, medicalent0_.med_area_cd as med_area2_1_, medicalent0_.area_nm as area_nm3_1_ from t_med_area medicalent0_
2020-02-11 15:26:01.377 TRACE 39096 --- [nio-8080-exec-2] o.s.t.i.TransactionInterceptor : Completing transaction for [org.springframework.data.jpa.repository.support.SimpleJpaRepository.findAll]
2020-02-11 15:26:01.383 TRACE 39096 --- [nio-8080-exec-2] .s.t.s.TransactionSynchronizationManager : Removed value [org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$DefaultCrudMethodMetadata#2930e0de] for key [public abstract java.util.List org.springframework.data.jpa.repository.JpaRepository.findAll()] from thread [http-nio-8080-exec-2]
Hibernate: select z0_.med_area_id as med_area6_0_0_, z0_.id as id1_0_0_, z0_.id as id1_0_1_, z0_.facility_code as facility2_0_1_, z0_.facility_id as facility3_0_1_, z0_.facility_nm as facility4_0_1_, z0_.insert_dt as insert_d5_0_1_, z0_.med_area_id as med_area6_0_1_ from t_facility z0_ where z0_.med_area_id=?
Hibernate: select z0_.med_area_id as med_area6_0_0_, z0_.id as id1_0_0_, z0_.id as id1_0_1_, z0_.facility_code as facility2_0_1_, z0_.facility_id as facility3_0_1_, z0_.facility_nm as facility4_0_1_, z0_.insert_dt as insert_d5_0_1_, z0_.med_area_id as med_area6_0_1_ from t_facility z0_ where z0_.med_area_id=?
Hibernate: select z0_.med_area_id as med_area6_0_0_, z0_.id as id1_0_0_, z0_.id as id1_0_1_, z0_.facility_code as facility2_0_1_, z0_.facility_id as facility3_0_1_, z0_.facility_nm as facility4_0_1_, z0_.insert_dt as insert_d5_0_1_, z0_.med_area_id as med_area6_0_1_ from t_facility z0_ where z0_.med_area_id=?.
My question is: Why is it fetching the details of FacilityEntity?I am not explicitly making any calls to get the properties of FacilityEntity.
When you say 'hover' do you mean while debugging? If you inspect any of the lazy elements its akin to accessing them, so hibernate will attempt to lazy load the entity.

MongoDB Morphia only saving 1 user

Hi guys i'me having troubles using morphia for mongodb this is what im creating.
Im creating a spigot plugin for my hub server and im using mongodb with morphia for store my user object to my collection and this object only store 1 user instead of saving all users into the collection.
My user object
#Entity(value = "clientdata", noClassnameStored = true)
public class ClientData {
#Id
public int id;
#Indexed(options = #IndexOptions(unique = true))
private String uuid;
#Indexed
private String lastName, username, lastLoginDate, ip;
#Indexed
private int level, exp, joins, coins, pearls;
#Property("hats")
private List<Integer> hatsOwned;
public ClientData(){
this.hatsOwned = new ArrayList<>();
if(this.hatsOwned.isEmpty()){
this.hatsOwned.add(0);
}
}
public int getId() {
return id;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public void setId(int id) {
this.id = id;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
public int getExp() {
return exp;
}
public void setExp(int exp) {
this.exp = exp;
}
public int getJoins() {
return joins;
}
public void setJoins(int joins) {
this.joins = joins;
}
public void addJoins(int joins) {
this.joins += joins;
}
public int getCoins() {
return coins;
}
public void setCoins(int coins) {
this.coins = coins;
}
public int getPearls() {
return pearls;
}
public void setPearls(int pearls) {
this.pearls = pearls;
}
public List<Integer> getHatsOwned() {
return hatsOwned;
}
public void setHatsOwned(List<Integer> hatsOwned) {
this.hatsOwned = hatsOwned;
}
public void addNewHatOwned(int hatID){
this.hatsOwned.add(hatID);
}
public String getLastLoginDate() {
return lastLoginDate;
}
public void setLastLoginDate(String lastLoginDate) {
this.lastLoginDate = lastLoginDate;
}
}
My mongo manager class
public class MongoManager {
private static MongoManager ins = new MongoManager();
private MongoClient mc;
private Morphia morphia;
private Datastore datastore;
private ClientDAO userDAO;
public static MongoManager get() {
return ins;
}
public void init() {
ServerAddress addr = new ServerAddress("127.0.0.1", 27017);
List<MongoCredential> credentials = new ArrayList<>();
credentials.add(MongoCredential.createCredential("union", "admin", "union16".toCharArray()));
mc = new MongoClient(addr, credentials);
morphia = new Morphia();
morphia.map(ClientData.class);
datastore = morphia.createDatastore(mc, "admin");
datastore.ensureIndexes();
userDAO = new ClientDAO(ClientData.class, datastore);
}
public void disconnect(){
this.mc.close();
}
public ClientData getUserByPlayer(Player player) {
ClientData du = userDAO.findOne("uuid", player.getUniqueId().toString());
long time = System.currentTimeMillis();
if (du == null) {
du = new ClientData();
du.setUuid(player.getUniqueId().toString());
du.setCoins(0);
du.setExp(0);
du.setJoins(0);
du.setLastLoginDate(DateFormat.getTimeInstance().format(time));
du.setLevel(0);
du.setPearls(0);
du.setIp(player.getAddress().getAddress().toString());
du.setUsername(player.getDisplayName());
du.setLastName(player.getName());
du.setHatsOwned(null);
userDAO.save(du);
}
return du;
}
public void saveUser(ClientData user) {
userDAO.save(user);
}
public List<ClientData> getAllUsers() {
return userDAO.find().asList();
}
}
You can't insert more than one because you have duplicateKey: you can't use an #id with primitive type without setting a unique value yourself.
You defined your id like this:
#Id
public int id;
Even though you never set any value for id, primitive types are initialized to 0, so you end up trying to insert multiple documents with the same key.
Solution:
You can either :
change your id to String: #Id String id;
change your id to ObjectId: #Id ObjectId id;
keep #Id int id and manually set a unique value to it (player.getUniqueId() for instance).
The first 2 options will work because they won't be initialized and will be null. Mongo will then generate a unique id for you.

json and wrapper for gson

I am trying to get some the array of actors from Jira. The code for the wrapper is used in a Gson.fromJson call. I had used something similar with a json string that did not have an array in it that had the information I needed and it worked fine, so the issue seems to do with the array, but I am not 100% sure:
import com.google.gson.annotations.SerializedName;
public class JiraRoleJsonWrapper {
#SerializedName("self")
private String self;
#SerializedName("name")
private String name;
#SerializedName("id")
private int id;
#SerializedName("description")
private String description;
#SerializedName("actors")
private JiraActors[] actors;
public JiraActors[] getActors() {
return actors;
}
public void setActors(JiraActors[] actors) {
this.actors = actors;
}
public String getSelf() {
return self;
}
public void setSelf(String self) {
this.self = self;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(String key) {
this.description = description;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
/*
public String[] getAvatarUrls() {
return avatarUrls;
}
public void setAvatarUrls(String[] avatarUrls) {
this.avatarUrls = avatarUrls;
}
*/
}
class JiraActors {
#SerializedName("id")
private int id;
#SerializedName("displayNme")
private String displayName;
#SerializedName("type")
private String type;
#SerializedName("name")
private String name;
//#SerializedName("avatarUrl")
//private String avatarUrl;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
The json it would receive:
{
"self":"http://someserver.com:8080/apps/jira/rest/api/2/project/10741/role/10002",
"name":"Administrators",
"id":10002,
"description":"A project role",
"actors":[
{
"id":12432,
"displayName":"Joe Smith",
"type":"atlassian-user-role-actor",
"name":"joesmi",
"avatarUrl":"/apps/jira/secure/useravatar?size=xsmall&ownerId=dawsmi&avatarId=12245"
},
{
"id":12612,
"displayName":"Smurfette Desdemona",
"type":"atlassian-user-role-actor",
"name":"smudes",
"avatarUrl":"/apps/jira/secure/useravatar?size=xsmall&ownerId=lamade&avatarId=10100"
},
This shows two actors and the format of the json. Please note I did not put a complete json response. It just shows two actors.
In my code, I tried the following to retrieve the actors:
InputStream is = response.getEntityInputStream();
Reader reader = new InputStreamReader(is);
Gson gson = new Gson();
JiraRoleJsonWrapper[] jiraRoleJsonWrapper = gson.fromJson(reader, JiraRoleJsonWrapper[].class);
for (JiraRoleJsonWrapper w : jiraRoleJsonWrapper) {
JiraActors[] a = w.getActors();
String name = a.getName();
It does not find getName for some reason. I am not sure why.
I figured it out.
I change the setActors to
public void setActors(ArrayList<JiraActors> actors) {
this.actors = actors;
}
Then I was able to get the array list and get access to the getName() method of JiraActors.

How to write query in hibernate(HQL) to perform 2 joins without mapping?

I want to convert the following query into HQL:
SELECT C.ID, E.DESCRIPTION as STATUS, E1.DESCRIPTION as SUBJECT
FROM CRED C
join CODE_EVN E
ON E.CODE = C.STATUS_CODE
AND E.SUBCODE = C.STATUS_SUBCODE
join CODE_EVN E1
ON E1.CODE = C.SUBJECT_CODE
AND E1.SUBCODE = C.SUBJECT_SUBCODE
I have two classes User and Codes with no mapping in between them, so how do I execute the following query in Hibernate?
I have tried out many things but nothing seems to work
These are my 2 bean classes:
User class:
#Entity
#Table(name="CRED")
public class User {
private String id;
private String STATUS_CODE;
private String STATUS_SUBCODE;
private String SUBJECT_CODE;
private String SUBJECT_SUBCODE;
#Id
#Column(name="ID")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public void setSTATUS_CODE(String sTATUS_CODE) {
STATUS_CODE = sTATUS_CODE;
}
public String getSTATUS_CODE() {
return STATUS_CODE;
}
public void setSTATUS_SUBCODE(String sTATUS_SUBCODE) {
STATUS_SUBCODE = sTATUS_SUBCODE;
}
public String getSTATUS_SUBCODE() {
return STATUS_SUBCODE;
}
public void setSUBJECT_CODE(String sUBJECT_CODE) {
SUBJECT_CODE = sUBJECT_CODE;
}
public String getSUBJECT_CODE() {
return SUBJECT_CODE;
}
public void setSUBJECT_SUBCODE(String sUBJECT_SUBCODE) {
SUBJECT_SUBCODE = sUBJECT_SUBCODE;
}
public String getSUBJECT_SUBCODE() {
return SUBJECT_SUBCODE;
}
}
Codes class:
#Entity
#Table(name="CODE_EVN")
public class Codes {
#Id
private String CODE;
private String SUBCODE;
private String DESCRIPTION;
public void setCODE(String cODE) {
CODE = cODE;
}
public String getCODE() {
return CODE;
}
public void setSUBCODE(String sUBCODE) {
SUBCODE = sUBCODE;
}
public String getSUBCODE() {
return SUBCODE;
}
public void setDESCRIPTION(String dESCRIPTION) {
DESCRIPTION = dESCRIPTION;
}
public String getDESCRIPTION() {
return DESCRIPTION;
}
}

jax-rs response.getEntity not working

I want to use javax.ws.rs.core.Response to send and receive an Card entity object. But I don't know how to convert the contents back in to a Card object.
My testCreate() method should execute the create(Card card) method, receive back the json and convert it in to a card object. But I somehow always get type mismatches or it says that the getEntity() method can't be executed like this: response.getEntity(Card.class).
Does anybody know how I have to handle the response correctly so that I can convert the returned json entity in to a Card object again?
Here my CardResource method:
#POST
#Consumes(MediaType.APPLICATION_JSON)
#Produces(MediaType.APPLICATION_JSON)
public Response create(Card card) {
Card c = dao.create(card);
if(c.equals(null)) {
return Response.status(Status.BAD_REQUEST).entity("Create failed!").build();
}
return Response.status(Status.OK)
.entity(c)
.type(MediaType.APPLICATION_JSON)
.build();
}
And here my CardResourceTests class
#Test
public void testCreate() {
boolean thrown = false;
CardResource resource = new CardResource();
Card c = new Card(1, "Cardname", "12345678", 1, 1,
"cardname.jpg", new Date(), new Date());
try {
Response result = resource.create(c);
System.out.println(result.getEntity(Card.class)); // not working!!!
if(result.getStatus() != 200) {
thrown = true;
}
} catch(Exception e) {
e.printStackTrace();
thrown = true;
}
assertEquals("Result", false, thrown);
}
And here my Card.class
#XmlRootElement
#PersistenceCapable(detachable="true")
public class Card {
#PrimaryKey
#Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;
#Persistent
private Integer id;
#Persistent
private String name;
#Persistent
private String code;
#Persistent
private Integer cardProviderId;
#Persistent
private Integer codeTypeId;
#Persistent
private String picturePath;
#Persistent
private Boolean valid;
#Persistent
private Date mobCreationDate;
#Persistent
private Date mobModificationDate;
#Persistent
private Date creationDate;
#Persistent
private Date modificationDate;
public Card() {
this.setId(null);
this.setName(null);
this.setCode(null);
this.setCardProviderId(null);
this.setCodeTypeId(null);
this.setPicturePath(null);
this.setMobCreationDate(null);
this.setMobModificationDate(null);
this.setCreationDate(null);
this.setModificationDate(null);
}
public Card(Integer id, String name, String code, Integer cardProviderId,
Integer codeTypeId, String picturePath,
Date mobCreationDate, Date mobModificationDate) {
this.setId(id);
this.setName(name);
this.setCode(code);
this.setCardProviderId(cardProviderId);
this.setCodeTypeId(codeTypeId);
this.setPicturePath(picturePath);
this.setMobCreationDate(mobCreationDate);
this.setMobModificationDate(mobModificationDate);
this.setCreationDate(new Date());
this.setModificationDate(new Date());
}
public Key getKey() {
return key;
}
public void setKey(Key key) {
this.key = key;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public Integer getCardProviderId() {
return cardProviderId;
}
public void setCardProviderId(Integer cardProviderId) {
this.cardProviderId = cardProviderId;
}
public void setCode(String code) {
this.code = code;
}
public Integer getCodeTypeId() {
return codeTypeId;
}
public void setCodeTypeId(Integer codeTypeId) {
this.codeTypeId = codeTypeId;
}
public String getPicturePath() {
return picturePath;
}
public void setPicturePath(String picturePath) {
this.picturePath = picturePath;
}
public Date getCreationDate() {
return creationDate;
}
public void setCreationDate(Date creationDate) {
this.creationDate = creationDate;
}
public Date getModificationDate() {
return modificationDate;
}
public void setModificationDate(Date modificationDate) {
this.modificationDate = modificationDate;
}
public Date getMobCreationDate() {
return mobCreationDate;
}
public void setMobCreationDate(Date mobCreationDate) {
this.mobCreationDate = mobCreationDate;
}
public Date getMobModificationDate() {
return mobModificationDate;
}
public void setMobModificationDate(Date mobModificationDate) {
this.mobModificationDate = mobModificationDate;
}
public Boolean getValid() {
return valid;
}
public void setValid(Boolean valid) {
this.valid = valid;
}
}
And here my CardDAO class
public class CardDAO {
private final static Logger logger = Logger.getLogger(CardDAO.class.getName());
public Card create(Card card) {
PersistenceManager pm = PMF.get().getPersistenceManager();
Card c = new Card(card.getId(), card.getName(), card.getCode(),
card.getCardProviderId(), card.getCodeTypeId(), card.getPicturePath(),
new Date(), new Date());
try {
pm.makePersistent(c);
} catch(Exception e) {
logger.severe("Create failed: " + e.getMessage());
return null;
} finally {
pm.close();
}
return c;
}
}
Is your Card class using #XmlRootElement and #XmlElement annotations to enable JAXB mapping JSON to/from POJO?
See example:
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
#XmlRootElement
public class Book {
#XmlElement(name = "id")
String id;
//...
I am not sure that it is correct to call the annotated web-service method just like a simple method with params. Try to remove all annotations from your CardResource class and invoke this method simply like a class method.

Categories

Resources