1

I have added resteasy-jackson provider jar in my pom.xml I have one pojo class annotated with jaxb annotations :

Request.java

@XmlElement
public List<Object> getListSO() {
    return listSO;
}

I have written an resteasy client to access a rest webservice. I am passing this request object as a parameter to webservice.

Rest Webservice

@POST
@Path("/authorizefields")
@Produces("application/json; charset=ISO-8859-1")
@Consumes("application/json; charset=ISO-8859-1")
public Reply getFields(Request request) {
}

Now from rest client if i add some object to list say

listSO.add(new Sample());
request.setListSO(listSO);

and pass it to the rest webservice I am not able to get sample object in ws. Is there any jaxb or jackson annotation needed to put on list of object to support polymorphism?


Create a instance in sub-model from User model using Django social auth

I am using django social auth for social network login into my site and it works fine the user info is stored in the User model. But i have another model(ExtraInfo) that inherits the user model to store extra data. How do i create an new instance in the sub-model(ExtraInfo) when a new user is created in the User model by django social auth

I tried SOCIAL_AUTH_USER_MODEL = 'myapp.CustomUser' but this does not work since create_user method is not available for the sub-model

class ExtraInfo(User):
      phoneNo = models.CharField(max_length = 30)
      city = models.CharField(max_length = 30)
      state = models.CharField(max_length = 30)
4

0 回答 0