Reputation: 15420
How do I tell WCF to make use of wsdl arrayType? Like this:
<complexType name="ArrayOfString">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="string[]"/>
</restriction>
</complexContent>
</complexType>
This is what WCF is doing (The not expected)
<complexType name="ArrayOfstring">
<sequence>
<element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="xs:string"/>
</sequence>
<element name="ArrayOfstring" nillable="true" type="tns:ArrayOfstring"/>
</complexType>
Upvotes: 1
Views: 2035
Reputation: 364249
I think WCF doesn't support it out of the box because that is WSDL extension to standard XSD description of data type. Both XmlSerializer
and DataContractSerializer
should work with standard XSD in scenarios where web services are not involved at all so it uses the plain XSD approach.
If you need the first approach you can either write WSDL + XSDs yourselves or you can try to implement custom export extension - to use that for WCF client generation you will also need custom import extension.
Upvotes: 0
Reputation: 15420
Found the solution. I have to add this to make it work: [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)]
Upvotes: 1