You need to sign in to do that
Don't have an account?

Error with .Net integration for ListViewRecord and ListViewRecordColumn from Salesforce API 32.0
After Winter release we encountered an issue for our .Net integration related to Soap API schema WSDL.
It is a known issue with the XML serialization class from .NET Framework all versions. The XMLSerializer code generation component cannot handle the XSD definitions that have only one element and the occurrence of the element is unbounded.
This is the case with the newly introduced classes ListViewRecord and ListViewRecordColumn from Salesforce API 32.0.
We had to manually modify the schema and altered the constructors for those 2 classes mentioned above by adding an extra dummy attribute.
This way the XMLSerializer code generator will use the proper XmlSerialization attributes for the constructor.
There should be a way to update WSDL from Salesforce to support .Net integration without manually update
Thank you!
It is a known issue with the XML serialization class from .NET Framework all versions. The XMLSerializer code generation component cannot handle the XSD definitions that have only one element and the occurrence of the element is unbounded.
This is the case with the newly introduced classes ListViewRecord and ListViewRecordColumn from Salesforce API 32.0.
We had to manually modify the schema and altered the constructors for those 2 classes mentioned above by adding an extra dummy attribute.
This way the XMLSerializer code generator will use the proper XmlSerialization attributes for the constructor.
There should be a way to update WSDL from Salesforce to support .Net integration without manually update
Thank you!
Exception Details: System.InvalidOperationException: Unable to generate a temporary class (result=1).
error CS0030: Cannot convert type 'SalesforceService.ListViewRecordColumn[]' to 'SalesforceService.ListViewRecordColumn'
error CS0030: Cannot convert type 'SalesforceService.ListViewRecordColumn[]' to 'SalesforceService.ListViewRecordColumn'
error CS0029: Cannot implicitly convert type 'SalesforceService.ListViewRecordColumn' to SalesforceService.ListViewRecordColumn[]'
error CS0029: Cannot implicitly convert type 'SalesforceService.ListViewRecordColumn' to 'SalesforceService.ListViewRecordColumn[]'
Before:
<complexType name="ListViewRecord">
<sequence>
<element name="columns" type="tns:ListViewRecordColumn" maxOccurs="unbounded"/>
</sequence>
</complexType>
<complexType name="ListViewRecordColumn">
<sequence>
<element name="fieldNameOrPath" type="xsd:string"/>
<element name="value" type="xsd:string" nillable="true"/>
</sequence>
</complexType>
After:
<complexType name="ListViewRecord">
<sequence>
<element name="columns" type="tns:ListViewRecordColumn" maxOccurs="unbounded"/>
</sequence>
<xsd:attribute name="tmp" type="xsd:string" />
</complexType>
<complexType name="ListViewRecordColumn">
<sequence>
<element name="fieldNameOrPath" type="xsd:string"/>
<element name="value" type="xsd:string" nillable="true"/>
</sequence>
<xsd:attribute name="tmp" type="xsd:string" />
</complexType>
<complexType name="ListViewRecord">
<sequence>
<element name="columns" type="tns:ListViewRecordColumn" maxOccurs="unbounded"/>
</sequence>
<xsd:attribute name="none" type="xsd:string" />
</complexType>
<complexType name="ListViewRecordColumn">
<sequence>
<element name="fieldNameOrPath" type="xsd:string"/>
<element name="value" type="xsd:string" nillable="true"/>
</sequence>
<xsd:attribute name="none2" type="xsd:string" />
</complexType>
Still getting the errors.
Ideas?
To get mine working I had to delete the extra [] from public ListViewRecordColumn[][] records in Reference.cs which is a file that is formed from the WSDL. I think that's a VS bug.
So that line should read
line 105930: private ListViewRecordColumn[][] recordsField;
line 105987: public ListViewRecordColumn[][] records {
to
line 105930: private ListViewRecordColumn[] recordsField;
line 105987: public ListViewRecordColumn[] records {
After I updated the Reference.cs as stated I was able to create an instance of SforceService without an exception error. I am using Visual Studio 2013 and .Net Framework 4.5. I imported my WSDL as a Web Reference.
--yvk
Salesforce, this is three years old. Why is there still a problem with the WSDL you generate not working for .NET?
<complexType name="ListViewRecord">
<sequence>
<element name="columns" type="tns:ListViewRecordColumn" minOccurs="1" maxOccurs="unbounded"/>
<element name="dummy" type="xsd:int"/>
</sequence>
</complexType>
public partial class ListViewRecord {
private ListViewRecordColumn[] columnsField;
private int dummyField;/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("columns")]
public ListViewRecordColumn[] columns {
get {
return this.columnsField;
}
set {
this.columnsField = value;
}
}
/// <remarks/>public int dummy {
get {
return this.dummyField;
}
set {
this.dummyField = value;
}
}
}