Print this page

"Unable to generate a temporary class (result=1)" is returned when .Net integration tries to parse the Enterprise WSDL version 32.0

Knowledge Article Number 000205824
Description In a Winter '15 org, I went to Settings | Develop | API | Generate Enterprise WSDL and clicked Generate to generate the Enterprise WSDL, but when I try to use this WSDL in a .NET integration I get an exception when evaluating the below line:

                    SforceService sfService = new SforceService();
 
Unable to generate a temporary class (result=1).
error CS0030: Cannot convert type 'xxx.Salesforce.ListViewRecordColumn[]' to 'xxx.Salesforce.ListViewRecordColumn'
error CS0030: Cannot convert type 'xxx.Salesforce.ListViewRecordColumn[]' to 'xxx.Salesforce.ListViewRecordColumn'
error CS0029: Cannot implicitly convert type 'xxx.Salesforce.ListViewRecordColumn' to 'xxx.Salesforce.ListViewRecordColumn[]'
error CS0029: Cannot implicitly convert type 'xxx.Salesforce.ListViewRecordColumn' to 'xxx.Salesforce.ListViewRecordColumn[]'
at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)
at System.Xml.Serialization.XmlSerializer.GetSerializersFromCache(XmlMapping[] mappings, Type type)
at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type)
at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
at xxx.Salesforce.SforceService..ctor()
at xxx.SalesforceClient.SalesForceClient.Connect()
Resolution In Winter '15 (API version 32.0), a number of additional sObjects are available including ListViewRecord, whose definition is as follows:

            <complexType name="ListViewRecord">
                <sequence>
                    <element name="columns"                  type="tns:ListViewRecordColumn" maxOccurs="unbounded"/>
                </sequence>
            </complexType>

As a result .Net integrations fail due to the error shown in the details section due to a bug in .NET's XmlSerializer as described in the following links: A workaround is provided in this post in the developer forums, which basically involves replacing all ocurrences of [][] with [], to then recompile the app.




promote demote