Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8135599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:28:25+00:00 2026-06-06T10:28:25+00:00

I’m developing a JERSEY RESTFUL web service which has a function that accept an

  • 0

I’m developing a JERSEY RESTFUL web service which has a function that accept an object parameter. It is called “Synchronize” and looks like this:

@XmlRootElement
public class Synchronize {

private List<PHQ9> phq9OutOfSync;
private List<ExtraQuestions> extraQuestionsOutOfSync;
private List<Suicide> suicideOutOfSync;
private List<Brugha> brughaOutOfSync;
private int hola;

public Synchronize() {

    phq9OutOfSync = new ArrayList<PHQ9>();
    extraQuestionsOutOfSync = new ArrayList<ExtraQuestions>();
    suicideOutOfSync = new ArrayList<Suicide>();
    brughaOutOfSync = new ArrayList<Brugha>();
}
}

The problem is I am not able to send a xml with the serialization of this class to the web service. I send an xml with all the attributes but it doesn’t deserialize it well… I don’t know if it is because the Lists that are doing some problems or so. I even tried sending only the int attribute like:

<synchronize><hola>1</hola></synchronize>

and doesn’t work too… What is going on?

Any hints?

EDIT: I’m seeing that I don’t know how I can refer to an attribute that is in a class. I tried making a web service that accepts a list with phq9 objects, and it works great, but if I put that list in other class, then it doesn’t know how to deserialize. Why could it be?

EDIT2:

@XmlRootElement
public class PHQ9 {

@XmlElement
private int id;
@XmlElement
private int patientId;
@XmlElement
private int answer1;
@XmlElement
private int answer2;
@XmlElement
private int answer3;
@XmlElement
private int answer4;
@XmlElement
private int answer5;
@XmlElement
private int answer6;
@XmlElement
private int answer7;
@XmlElement
private int answer8;
@XmlElement
private int answer9;
@XmlElement
private int answer10;
@XmlElement
private int total;
@XmlElement
private int week;
@XmlElement
private String phq9Date;
@XmlElement
private String timeExported;
@XmlElement
private String dateExported;
@XmlElement
private int exported;

public PHQ9() {

    phq9Date = timeExported = dateExported = "";        
}
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T10:28:27+00:00Added an answer on June 6, 2026 at 10:28 am

    [EDIT]

    In regards to lists, take a look at JAXB: How to marshal objects in lists? on how to wrap lists, if desired.

    You can limit which members are to be serialized using XmlAccessorType (http://docs.oracle.com/javaee/5/api/javax/xml/bind/annotation/XmlAccessorType.html) and XmlElement (http://docs.oracle.com/javaee/5/api/javax/xml/bind/annotation/XmlElement.html).

    It is possible you are trying to serialize/deserialize an unsupported class, causing it to fail. Are you getting any exceptions or is it just failing silently? Have you tried taking a look at the raw data being sent/received?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I need a function that will clean a strings' special characters. I do NOT
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.