Problem about the Salesforce SOAP API 32.0 in. Net Project

Source: Internet
Author: User
Tags wsdl

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.