Loading
ただいま大変多くのお問い合わせをいただいており、ご連絡までにお時間を頂戴しております続きを読む

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

公開日: Jun 17, 2026
説明
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()
解決策

This issue is caused by a bug in .NET's XmlSerializer introduced by a new sObject type in Salesforce Winter '15 (API version 32.0).


What Changed in API v32.0

In Winter '15, a new sObject called ListViewRecord was added to the Enterprise WSDL. Its column definition used an unbounded occurrence (maxOccurs="unbounded") for the columns element of type ListViewRecordColumn. This pattern exposes a known bug in .NET's XmlSerializer, which cannot correctly serialize an unbounded sequence of a type that itself appears as an array reference elsewhere in the generated proxy.


Fix the Generated Proxy Classes

To resolve this, open the generated .NET proxy classes and replace all occurrences of the double-array notation [][] with single-array notation []. Once the substitution is complete, recompile the application. This resolves the type conversion conflicts that the XmlSerializer encounters.
For a detailed reference on this XmlSerializer behavior, see the Microsoft MSDN forum thread "Unable to generate temporary classes with BizTalk 2006 Published WebServices."
For the original Salesforce community workaround thread, see the Salesforce Developer Forums reference linked in the Additional Resources section.

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

 

その他のリソース

 

 

ナレッジ記事番号

000386974

 
読み込み中
Salesforce Help | Article