[英]SoapUI error with Yii generated WSDL
我有一個Yii網絡服務。 WSDL是自動生成的,但是在使用SoapUI測試它時會出錯。
這是我得到的錯誤的一個例子:
Mon Sep 02 17:24:53 CEST 2013:ERROR:org.apache.xmlbeans.XmlException: union value 'unbounded' does not match any members of 'type of maxOccurs attribute in xs:narrowMaxMin'
我確實有這樣的1-N關系:
/**
* @var Foo[] Foos {nillable=true, minOccurs=0, maxOccurs=unbounded}
* @soap
*/
public $foos;
據我所知maxOccurs=unbounded
應該是正確的,那么它有什么問題呢?
干杯!
你能提供你生成的wsdl的更詳細的例子嗎? 您可能會收到此錯誤,例如,如果“foo”元素位於xs:all標記內 - 它指定每個子元素可以出現零次或一次,因此maxOccurs值必須為1.此問題通過將元素放在xs中來解決:序列標記而不是xs:all為maxOccurs啟用“無界”值。
好吧,明白了!
屬性$foos
實際上並不是unbounded
:它是一個Foo
數組,但作為一個屬性,它只出現0或1次......所以沒有unbounded
,但在maxOccurs
1
:
/**
* @var Foo[] Foos {nillable=true, minOccurs=0, maxOccurs=1}
* @soap
*/
public $foos;
好極了!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.