Java 属性";“元素”;代表权

Java 属性";“元素”;代表权,java,wadl,Java,Wadl,根据WADL规范(第2.11.2节): 元素 For XML-based representations, specifies the qualified name of the root element as described within the grammars section - see section 2.4 . 是否可以在元素属性中指定complexType?我有一个只定义complexTypes的XML模式。这些complexTypes的实例可以作为表示包含在HTTP请求/

根据WADL规范(第2.11.2节):

元素

  For XML-based representations, specifies the qualified name of the root element as described within the grammars section - see section 2.4 .
是否可以在元素属性中指定
complexType
?我有一个只定义
complexType
s的XML模式。这些
complexType
s的实例可以作为表示包含在HTTP请求/响应中

例如,以下方法声明有效吗

<method id="saveA" name="PUT">
    <request>
        <representation mediaType="application/xml" element="ns1:AType" />
    </request>
    .......
</method>

.......
(其中
AType
是在名称空间
ns1
下的XML模式中定义的
complexType

或者,我是否应该在XML模式中定义一个名为
a
AType
类型的根元素,并将该元素的限定名设置为表示的属性元素

p.S.:我尝试了第二个选项(在XML模式中定义根元素),当我从WADL(使用WADL2Java)生成代码时,
saveA
方法不会将
AType
的实例作为参数。因此,我无法访问方法中添加的元素