Soap unmarshal exception

0

Mam problem przy odbieraniu obiektu przez soap:

Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"results"). Expected elements are <{}type>,<{}name>

Zwracany obiekt:

public ExportResult implements Serializable {
private String name;
private String type;
private Map<String, Result> results = new HashMap<>();

public ExportResult(){}
public ExportResult(String name, String type) {
this.name = name;
this.type = type;
}

settery i gettery...
} 

Zwracany xml

 <exportResult>
<name>test</name>
<type>tesType</type>
<results>
<entry>
<key>testKey</key>
<value><result>estValue</result><date>10-02-2016</date>
</value>
</entry>
</results>
</exportResult>

W czym moze byc problem? juz nie mam pomyslow...

0

Znalazłem źródło problemu

setResults(HashMap<String, Result> results) {this.results = results; }

Po zmiane typu mapy na interfejs Map działa. Jest jakięs jasne wytlumaczenie czemu nie działa z typem HashMap ?

1 użytkowników online, w tym zalogowanych: 0, gości: 1