+ Start a Discussion
Yaakov EllisYaakov Ellis 

WSDL Imported into .Net Results in Errors with ListViewRecordColumn[]

Bug is documented at http://www.fishofprey.com/2014/10/importing-salesforce-winter-15-partner.html

This has been present since Fall 2014.

When the wsdl is converted into a .Net web service, the ListViewRecordColumn is now defined in .Net at `typeof(ListViewRecordColumn)` instead of `typeof(ListViewRecordColumn[])`. 

This will result in the following errors appearing unless it is manually corrected in the generated c#
  • System.InvalidOperationException: Unable to generate a temporary class (result=1).
  • error CS0029: Cannot implicitly convert type 'XYZ.SalesforcePartner.ListViewRecordColumn' to 'XYZ.SalesforcePartner.ListViewRecordColumn[]'
DeepthiDeepthi (Salesforce Developers) 
Hi Yaakov,

The above error has occurred due to a bug in .NET's XmlSerializer while Integrating through your Enterprise WSDL. Please follow the below article to resolve your issue.


Hope this helps you!
Best Regards,
Daniel BallingerDaniel Ballinger
Hi Yaakov,

I had a link at the end of my blog post to an article by Microsoft that stated they weren't going to fix it - XSD.EXE - Incorrect Class Generated for Abstract Type With Derived Types (https://connect.microsoft.com/VisualStudio/feedback/details/362727/xsd-exe-incorrect-class-generated-for-abstract-type-with-derived-types). Unfortunately that linked page appears to be gone. There is a cached version (https://www.google.co.nz/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwif-avilbXNAhVLmpQKHQ2vAdsQIAgdMAA&url=https%3A%2F%2Fwebcache.googleusercontent.com%2Fsearch%3Fq%3Dcache%3ANyRH1OSJwWUJ%3Ahttps%3A%2F%2Fconnect.microsoft.com%2FVisualStudio%2Ffeedback%2Fdetails%2F362727%2Fxsd-exe-incorrect-class-generated-for-abstract-type-with-derived-types%2B%26cd%3D1%26hl%3Den%26ct%3Dclnk%26gl%3Dnz&usg=AFQjCNEssJzQMiIu_SUY4bGn_gemgKf-0w&sig2=LZ72SqWGbpGtrhnLoZkjyw) - but it not just bounces to an authentication page.

So any fix for this would probably require Salesforce to alter their WSDL, but it isn't really a problem with their WSDL.
Simply find for [][] in your WSDL and replace them with single [] and that should resolve your issue.