Note that there are some explanatory texts on larger screens.

plurals
  1. POWCF: collection proxy type on client
    primarykey
    data
    text
    <p>I have the following type in wsdl (it is generated by third party tool):</p> <pre><code>&lt;xsd:complexType name="IntArray"&gt; &lt;xsd:sequence&gt; &lt;xsd:element maxOccurs="unbounded" minOccurs="0" name="Elements" type="xsd:int" /&gt; &lt;/xsd:sequence&gt; &lt;/xsd:complexType&gt; </code></pre> <p>Sometimes Visual Studio generates:</p> <pre><code>public class IntArray : System.Collections.Generic.List&lt;int&gt; {} </code></pre> <p>And sometimes it doesn't generate any proxy type for this wsdl and just uses int[].</p> <p>Collection type in Web Service configuration is System.Array.</p> <p>What could be the reason for such upredictable behavior?</p> <p><strong>Edited:</strong></p> <p>I found the way how I can reproduce this behavior.</p> <p>For examle we have two types:</p> <pre><code>&lt;xsd:complexType name="IntArray"&gt; &lt;xsd:sequence&gt; &lt;xsd:element maxOccurs="unbounded" minOccurs="0" name="Elements" type="xsd:int" /&gt; &lt;/xsd:sequence&gt; &lt;/xsd:complexType&gt; &lt;xsd:complexType name="StringArray"&gt; &lt;xsd:sequence&gt; &lt;xsd:element maxOccurs="unbounded" minOccurs="0" name="Elements" type="xsd:string" /&gt; &lt;/xsd:sequence&gt; &lt;/xsd:complexType&gt; </code></pre> <p>VS generates:</p> <pre><code>public class IntArray : System.Collections.Generic.List&lt;int&gt; {} public class StringArray : System.Collections.Generic.List&lt;string&gt; {} </code></pre> <p>Now I change StringArray type:</p> <pre><code>&lt;xsd:complexType name="StringArray"&gt; &lt;xsd:sequence&gt; &lt;xsd:element maxOccurs="unbounded" minOccurs="0" name="Elements" type="xsd:string" /&gt; &lt;xsd:any minOccurs="0" maxOccurs="unbounded" namespace="##any" processContents="lax" /&gt; &lt;/xsd:sequence&gt; &lt;xsd:anyAttribute namespace="##any" processContents="lax"/&gt; &lt;/xsd:complexType&gt; </code></pre> <p>VS generates proxy type for StringArray only. But not for IntArray.</p> <p><strong>Edited:</strong></p> <p>Reference.svcmap:</p> <pre><code> &lt;ClientOptions&gt; &lt;GenerateAsynchronousMethods&gt;false&lt;/GenerateAsynchronousMethods&gt; &lt;EnableDataBinding&gt;true&lt;/EnableDataBinding&gt; &lt;ExcludedTypes /&gt; &lt;ImportXmlTypes&gt;false&lt;/ImportXmlTypes&gt; &lt;GenerateInternalTypes&gt;false&lt;/GenerateInternalTypes&gt; &lt;GenerateMessageContracts&gt;false&lt;/GenerateMessageContracts&gt; &lt;NamespaceMappings /&gt; &lt;CollectionMappings /&gt; &lt;GenerateSerializableTypes&gt;true&lt;/GenerateSerializableTypes&gt; &lt;Serializer&gt;Auto&lt;/Serializer&gt; &lt;ReferenceAllAssemblies&gt;true&lt;/ReferenceAllAssemblies&gt; &lt;ReferencedAssemblies /&gt; &lt;ReferencedDataContractTypes /&gt; &lt;ServiceContractMappings /&gt; &lt;/ClientOptions&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload