+ Start a Discussion
webservices2webservices2 

API version 32 - Creating new SforceService gives error

I just generated a new enterprise wsdl from the Sandbox which has the new api version 32.

On the login call:

SforceService sforceSession = new SforceService();

it is generating the following error:

System.InvalidOperationException: Unable to generate a temporary class (result=1).
error CS0030: Cannot convert type 'xxx.ListViewRecordColumn[]' to 'xxx.ListViewRecordColumn'
error CS0030: Cannot convert type 'xxx.ListViewRecordColumn[]' to 'xxx.ListViewRecordColumn'
error CS0029: Cannot implicitly convert type 'xxx.ListViewRecordColumn' to 'xxx.ListViewRecordColumn[]'
error CS0029: Cannot implicitly convert type 'xxx.ListViewRecordColumn' to 'xxx.ListViewRecordColumn[]'

It works fine is I use the previous wsdl. Did the object change?

Thanks
Best Answer chosen by webservices2
Jean-NoelJean-Noel
This is a new type in the API 32.0 http://releasenotes.docs.salesforce.com/en-us/winter15/release-notes/rn_api_calls.htm 

After transfering hte WSDL file in a class for .net, I have the same issue.
To solve it, I have updated the class file to search and replace
ListViewRecordColumn[][]
and replace it with
ListViewRecordColumn[]
It have solve the login issue.

All Answers

Jean-NoelJean-Noel
This is a new type in the API 32.0 http://releasenotes.docs.salesforce.com/en-us/winter15/release-notes/rn_api_calls.htm 

After transfering hte WSDL file in a class for .net, I have the same issue.
To solve it, I have updated the class file to search and replace
ListViewRecordColumn[][]
and replace it with
ListViewRecordColumn[]
It have solve the login issue.
This was selected as the best answer
jappenzeller2jappenzeller2
I have the same problem but I'm not finding that array definition in the wsdl.  Where is it?
Terry DowningTerry Downing
This is not a fix though, merely a work around.

The array definition ios NOT in the WSDL, it is in the Reference.cs class in more than one place.  If the service refernce is used in different projects, it needs to be update dinall of them as well.
 
Open 2Open 2
I am having this same issue. However, I don't have a Reference.cs file.
I have a VB.NET webservice which connects to salesforce via SOAP using the older wsdl from version 24 and when I try to update the wsdl to version 32, I get this error. I haven't found a solution yet. Any guidance would be appreciated.
API AutoAPI Auto
I went through the proxy classes (Enterprise and Partner) that were generated, and, following the advice of Jean-Noel, did the following.

removed extra () after recordsField() - recordsField()() became recordsField()
removed extra () after ListViewRecordColumn() - ListViewRecordColumn()() became ListViewRecordColumn()

The definitions inside the WSDL don't look like they have any issues.

I have no idea why the .NET WSDL.EXE (WSDL to proxy class tool) caused it to be generated that way.

In any case, it seems to have fixed the issue.
Terry DowningTerry Downing
Again, this is a work aorund not a fix.  I have to fix my reference files everytime I update and since we're in a development cycle, that meas eveytime. If you have more than one project that uses these references, then the proxy classes in each project need to be updated.

Open2,

look for the reference.vb file generated by either updating the service reference or adding it.

In you project file structure you should have a folder called ServiceReferences

example:
drive letter:\[project path]\[Project Name]\Service References\

and then in that folder/directory a folder for each service reference tah was added to you project
drive letter:\[project path]\[Project Name]\Service References\SalesforceEnterpriseWSDL

This is where the proxy classes are created on your system. MS protects you from your self and does not make them available in your project. You have to dig around for them.

Reference.cs or Reference.vb depending on you language is the one that needs to be fixed manually.

for cs files look for [][] and replace with []
for vb files look for ()() and replace with ()

Hope this helps.

Terry
 
Shenwei LiuShenwei Liu
I encountered the same issue with the Enterprise WSDL just downloaded from the SFDC. This did not occur with the previous versions of the API. The base problem is that the ListViewRecordColumn type is nested in the ListViewRecord type which is referenced by some methods in the WSDL. The generated reference.cs (or equivalent vb) file doesn’t include the ListViewRecord type but adds an additional square brackes pair to the ListViewRecordColumn[][] instead. Since the ListViewRecord type only contains the ListViewRecordColumn subtype, the workaround using the ListViewRecordColumn array (removing one of the double []) may be fine for now. But it’s inconvenient. Not sure why the SFDC created this nested type for arrays (I haven't used these types and related methods yet). The solution may be to modify either the WSDL by SFDC or the reference/proxy class code generation scenarios by Microsoft. 
DRK78DRK78
FYI.. still happens with v41.  The workaround is still valid.   Thanks!
Brian Watts 12Brian Watts 12
Instead of patching the resultant "Reference.cs" or "Reference.vb" file, this alternate workaround seems to head the problem off nicely for me:

Edit your wsdl.xml file like this:
 
<complexType name="ListViewRecord">
                <sequence>
                    <element name="columns" type="tns:ListViewRecordColumn" minOccurs="1" maxOccurs="1"/>
                </sequence>
</complexType>

In the above snippet, I've changed the maxOccurs from "unbounded" to maxOccurs="1"

Sometimes Visual Studio tricks me and rebuilds the Reference class, so, fixing it at the WSDL level really helps