![](/img/trans.png)
[英]How to automatically add xsd:attribute to xsd:complexType in Apache XMLBeans?
[英]Write xsd:type attribute in Apache XmlBeans
關於Apache XmlBeans。 我在方案定義(xsd:anyType)中使用AnyType作為復雜類型的元素。 例:
<request xmlns="">
<xml>
<input1>
<string>str</string>
</input1>
</xml>
</request>
用Java代碼
final ProcessRequest processRequest = requestDocument.addNewRequest();
XmlObject xml = processRequest.addNewXml();
xml.changeType(operationType.type);
xml.set(operationType);
我想看看
<xml xsd:type="*opeation1NSPrefix*:*operation1Type*>
...
</xml>
但我只能看到<xml/>
。 我做錯了什么?
愚蠢的錯誤:operation1在wsdl中定義為匿名類型<element><complexType>..</></>
。 當我定義"<element type=".."/><complexType name=".."/>
,問題消失了
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.