简体   繁体   English

WSDL和XSD列表声明

[英]WSDL and XSD List declaration

Today I have the folowwing xsd declaration that is generated to Array 今天,我有下面的xsd声明,该声明已生成到Array

<xs:element name="SubNodes" type="Node" minOccurs="0" maxOccurs="unbounded"/>

How can I do something that will be generated to List<> ? 我该怎么做,将生成List <>?

(Using c#) (使用C#)

Update: 更新:

I've tried 我试过了

<xs:simpleType name="SubNodes">
                    <xs:list itemType="Node"/>
                </xs:simpleType>

but got the error: 但是得到了错误:

The 'http://www.w3.org/2001/XMLSchema:simpleType' element is not supported in this context 在此上下文中不支持“ http://www.w3.org/2001/XMLSchema:simpleType”元素

What tool are you using to generate the wsdl? 您使用什么工具来生成wsdl? I will assume it is visual studio. 我会假设它是视觉工作室。

In that case when you generate the service reference, click "Advanced" and you should see this screen where you can select the collection type: 在这种情况下,当您生成服务引用时,单击“高级”,您应该看到此屏幕,您可以在其中选择集合类型:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM