表示的java属性“元素”
根据WADL规范(第2.11.2节):
element
For XML-based representations, specifies the qualified name of the root element as described within the grammars section - see section 2.4 .
是否可以在元素属性中指定complexType
?我有一个只定义complexType
的XML模式。这些complexType
的实例可以作为表示包含在HTTP请求/响应中
例如,以下方法声明有效吗
<method id="saveA" name="PUT">
<request>
<representation mediaType="application/xml" element="ns1:AType" />
</request>
.......
</method>
(其中AType
是在XML模式中命名空间ns1
下定义的complexType
)
或者,我应该在XML模式中定义一个名为a
的AType
类型的根元素,并将该元素的限定名设置为表示的属性元素
p.S.:我尝试了第二个选项(在XML模式中定义根元素),当我从WADL(使用WADL2Java)生成代码时,saveA
方法不会将AType
的实例作为参数。因此,我无法访问方法中添加的元素
共 (0) 个答案