我正在构建一个java webservice,它接收LinkedHashMap
作为参数。 LinkedHashMap
集合在客户端插入了一些元素,但我在 Web 服务中收到的元素是空的。
最佳答案
Avoid returning collections directly. Instead of returning a
List<X>
, return a JavaBean that has aList<X>
in it. This will give you more detailed control over the marshalling anyway.
Producing a Web Service with JAX-WS and JAXB
另请参阅:
关于java - JAX-WS,为什么收到的LinkedHashMap集合是空的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12905315/