我在 Jersey v1.13 中有两个类注释如下:
@XmlRootElement(name="request_pojo")
public class RequestPojo {
public String name;
@XmlElementWrapper(name = "nested_pojos")
@XmlElement(name = "nested_pojo")
public List<NestedPojo> nestedPojo;
}
@XmlRootElement(name="nested_pojo")
public class NestedPojo {
public String name;
}
当我尝试使用 Jersey 客户端序列化RequestPojo
具有 s 集合的 a 时NestedPojo
......我没有看到它们在日志中被编组:
INFO: 1 * Client out-bound request
23:30:45 web.1 | 1 > POST https://localhost:443/test/
23:30:45 web.1 | 1 > Content-Type: application/xml
23:30:45 web.1 | <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<request_pojo>
<name>blah</name>
</request_pojo>
我必须解决什么问题才能看到球衣客户将以下内容放到线上?
<request_pojo>
<name>blah</name>
<nested_pojos>
<nested_pojo>
<name>nested blah</name>
</nested_pojo>
</nested_pojos>
</request_pojo>