Note that there are some explanatory texts on larger screens.

plurals
  1. POHow unmarshalling xml List objects
    primarykey
    data
    text
    <p>How unmarshalling list XML object in my android aplication.</p> <p>I using rest spring for call rest services: <a href="http://www.springsource.org/spring-android" rel="nofollow">http://www.springsource.org/spring-android</a>,</p> <p>and SimpleXml (http://simple.sourceforge.net/) for convert xml to POJO.</p> <p>I dont have problem with convert one object from XML.</p> <p>I try this: </p> <pre><code>HttpHeaders requestHeaders = new HttpHeaders(); requestHeaders.setAcceptEncoding(ContentCodingType.ALL); RestTemplate restTemplate = new RestTemplate(); restTemplate.getMessageConverters().add(new SimpleXmlHttpMessageConverter()); artikli [] response =(artikli[])restTemplate.getForObject(url, artikli[].class); </code></pre> <p>but dont work.</p> <p>There is a xml code:</p> <pre><code>&lt;kategorijaartiklas&gt; &lt;kategorijaartikla&gt; &lt;id&gt;1&lt;/id&gt; &lt;kategorija&gt;kategorija1&lt;/kategorija&gt; &lt;/kategorijaartikla&gt; &lt;kategorijaartikla&gt; &lt;id&gt;2&lt;/id&gt; &lt;kategorija&gt;kategorija2&lt;/kategorija&gt; &lt;/kategorijaartikla&gt; &lt;/kategorijaartiklas&gt; </code></pre> <p>Java class:</p> <pre><code>@Root public class kategorijaartikla { @Element private Integer id; @Element private String kategorija; public kategorijaartikla() { // TODO Add your own initialization code here. } public Integer getId() { return id; } public void setId(Integer newId) { this.id = newId; } public String getKategorija() { return kategorija; } public void setKategorija(String newKategorija) { this.kategorija = newKategorija; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload