Loading

Enterprise WSDL ERROR: 'Unable to generate a temporary class (result=1)'

Date de publication: Oct 13, 2022
Description
After you Generate Enterprise WSDL and try to use this WSDL in a .NET integration you may see 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()
Résolution
In Winter '15 (API version 32.0), a number of additional sObjects are available including ListViewRecord, which had the following definition:
 <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 link: A workaround involves replacing all occurrences of [][] with [], to then recompile the app.
Reference to workaround
 
Numéro d’article de la base de connaissances

000386974

 
Chargement
Salesforce Help | Article