This day I encounter a problem when working with web service SOAP. Something like this:
Cannot convert type 'SFDCSOAP.WebReference3rd.QuickActionLayoutItem[]' to 'SFDCSOAP.WebReference3rd.QuickActionLayoutItem'\r\nerror CS0030: Cannot convert type 'SFDCSOAP.WebReference3rd.QuickActionLayoutItem[]' to 'SFDCSOAP.WebReference3rd.QuickActionLayoutItem'\r\nerror CS0029: Cannot implicitly convert type 'SFDCSOAP.WebReference3rd.QuickActionLayoutItem' to 'SFDCSOAP.WebReference3rd.QuickActionLayoutItem[]'\r\nerror CS0029: Cannot implicitly convert type 'SFDCSOAP.WebReference3rd.QuickActionLayoutItem' to 'SFDCSOAP.WebReference3rd.QuickActionLayoutItem[]'
The error is triggered when you try to create an instance of a XmlSerializer with a parameter type of a class generated from an xsd with xsd.exe. It's a bug of xsd.exe.
The way I solved this problem is modifying the refrences.cs of that service from
[System.Xml.Serialization.XmlArrayItemAttribute("quickActionLayoutItems", typeof(QuickActionLayoutItem), IsNullable=false)]
public QuickActionLayoutItem[][] quickActionLayoutColumns {
}
To
[System.Xml.Serialization.XmlArrayItemAttribute("quickActionLayoutItems", typeof(QuickActionLayoutItem[]), IsNullable=false)]
public QuickActionLayoutItem[][] quickActionLayoutColumns {
}
Because of this
private QuickActionLayoutItem[][] quickActionLayoutColumnsField;
Happy coding! :)
0 comments :
Post a Comment