【发布时间】:2012-07-29 06:18:27
【问题描述】:
我的(简化的)情况:
服务 @WebService
容器 getContainer() @WebMethod
容器
void setObjects( ContainableObjects[] 对象)
ContainableObjects[] getObjects()
ContainableObjects [摘要]
void setName(字符串名称)
字符串 getName()
无效doSomething()
ContainedString [扩展 ContainableObjects]
void setValue(字符串值)
字符串 getValue()
无效 doSomethingElse()
ContainedInt [扩展 ContainableObject]
void setValue(int value)
整数 getValue()
无效doAnotherThing()
这些 POJO 对象已经存在。我正在使用 Eclipse 工具来生成 CXF 代码。
目前,Service.getContainer 将为我提供容器的表示。但是,CXF 不会发送比 ContainableObject 对象更多的信息。因此,客户端不会收到存储在子类中的值信息。
这种简化并没有完全说明使用子类的原因,但我向你保证这个原因是存在的。
显然,我需要告诉 CXF 有实现子类。但是我该怎么做呢?
【问题讨论】: