WSDL 中で以下のように定義しなおしてみたが…。。。
<xsd:complexType name="WordList">
<xsd:complexContent>
<xsd:restriction base="soapenc:Array">
<xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="typens:Word[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="Word">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="parent" type="xsd:string"
minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string"/>
<xsd:attribute name="idref" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="child" type="xsd:string"
minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string"/>
<xsd:attribute name="idref" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string"/>
<xsd:attribute name="origin" type="xsd:anyURI"/>
</xsd:complexType>
SOAP4R の wsdl2ruby が以下のようなエラーを吐く。
I, [2003-02-26T10:40:19.901794 #983] INFO -- app: Start of app.
F, [2003-02-26T10:40:19.960904 #983] FATAL -- app: Detected an exception. Stopping ... Unknown attr {}name. (WSDL::WSDLParser::UnknownAttributeError)
/usr/local/lib/ruby/site_ruby/1.6/wsdl/xmlSchema/attribute.rb:62:in `parseAttr'
/usr/local/lib/ruby/site_ruby/1.6/wsdl/parser.rb:188:in `decodeTag'
/usr/local/lib/ruby/site_ruby/1.6/wsdl/parser.rb:170:in `each'
/usr/local/lib/ruby/site_ruby/1.6/wsdl/parser.rb:170:in `decodeTag'
/usr/local/lib/ruby/site_ruby/1.6/wsdl/parser.rb:111:in `startElement'
/usr/local/lib/ruby/site_ruby/1.6/wsdl/xmlscanner.rb:170:in `on_stag_end'
/usr/local/lib/ruby/site_ruby/1.6/wsdl/xmlscanner.rb:165:in `on_stag_end_empty'
/usr/local/lib/ruby/site_ruby/1.6/xmlscan/scanner.rb:470:in `on_stag_end_empty'
/usr/local/lib/ruby/site_ruby/1.6/xmlscan/scanner.rb:792:in `scan_stag'
/usr/local/lib/ruby/site_ruby/1.6/xmlscan/scanner.rb:824:in `scan_content'
/usr/local/lib/ruby/site_ruby/1.6/xmlscan/scanner.rb:1048:in `scan_prolog'
/usr/local/lib/ruby/site_ruby/1.6/xmlscan/scanner.rb:1055:in `scan_document'
/usr/local/lib/ruby/site_ruby/1.6/xmlscan/scanner.rb:1070:in `parse_document'
/usr/local/lib/ruby/site_ruby/1.6/wsdl/xmlscanner.rb:44:in `doParse'
/usr/local/lib/ruby/site_ruby/1.6/wsdl/parser.rb:85:in `parse'
/home/masao/CVSwork/soap4r/bin/wsdl2ruby.rb:256:in `import'
/home/masao/CVSwork/soap4r/bin/wsdl2ruby.rb:45:in `run'
/usr/local/lib/ruby/site_ruby/1.6/devel/logger.rb:557:in `start'
/home/masao/CVSwork/soap4r/bin/wsdl2ruby.rb:260
I, [2003-02-26T10:40:19.961776 #983] INFO -- app: End of app. (status: -1)
おそらく、<xsd:attribute> の構造をどういうモデルで Ruby の構造に落
とすかについてのコンセンサスが無いために、これをエラーにしているよ
うだ。
WSDL 仕様においても「recommended approach」として以下の指針が示さ
れている。
* Use element form (not attribute).
cf. 「2.2 Types」 http://www.w3.org/TR/wsdl#_types
ちなみに、Apache Axis の WSDL2Java では変換できた。