A problem has recently been encountered in an integration project project: When you integrate in. Net with the latest version of Enterprise wsdl (API 32.0), class errors are initialized when you initialize Sforceservice. This is the Salesforce in the new version of the soap API bug, in the previous version does not have this problem, you need attention.
The specific error message is as follows:
Message:sync error,system.typeinitializationexception:the type initializer for ' SyncUtility.SForce.DataUility ' threw An exception. ---> System.TypeInitializationException:The type initializer for ' SyncUtility.SForce.ServiceProvider ' threw an exception. ---> System.InvalidOperationException:Unable to generate a temporary class (result=1).
Error cs0030:cannot convert type ' syncutility.sforce.enterpriseservice.listviewrecordcolumn[] ' to ' SyncUtility.SForce.EnterpriseService.ListViewRecordColumn '
Error cs0030:cannot convert type ' syncutility.sforce.enterpriseservice.listviewrecordcolumn[] ' to ' SyncUtility.SForce.EnterpriseService.ListViewRecordColumn '
Error cs0029:cannot implicitly convert type ' SyncUtility.SForce.EnterpriseService.ListViewRecordColumn ' to ' Syncutility.sforce.enterpriseservice.listviewrecordcolumn[] '
Error cs0029:cannot implicitly convert type ' SyncUtility.SForce.EnterpriseService.ListViewRecordColumn ' to ' Syncutility.sforce.enterpriseservice.listviewrecordcolumn[] '
cause of the problem:
is a new version of Salesforce WSDL that triggers Microsoft's one limitation on WSDL.
Here's how to fix it:
Method One:
After generating the proxy Class, replace all listviewrecordcolumn[][] to listviewrecordcolumn[];
Method Two:
Modify in the WSDL, save and then generate the proxy Class. The specific modifications are as follows:
Will
<complextype name= "Listviewrecordcolumn" >
<sequence>
<element name= "Fieldnameorpath" type= "xsd:string"/>
<element name= "value" type= "Xsd:string" nillable= "true"/>
</sequence>
</complexType>
Modified to:
<complextype name= "Listviewrecordcolumn" >
<sequence>
<element name= "Fieldnameorpath" type= "xsd:string"/>
<element name= "value" type= "Xsd:string" nillable= "true"/>
</sequence>
</complexType>
Ps:
When generating the WSDL, as shown below, this is not the problem of Salesforce, is the Firefox browser display problems, we do not panic, do not tangle. The right mouse button is saved as enterprise.wsdl, the file type is all files, and you will get the WSDL you need after saving.
Refrence:
Microsoft's limitations on WSDL:
https://connect.microsoft.com/VisualStudio/feedback/details/471297
Salesforce Community about this problem description: https://developer.salesforce.com/forums/ForumsMain?id=906F0000000AiPEIA0
Problem about the Salesforce SOAP API 32.0 in. Net Project