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

Enterprise WSDL .Net Unable to generate a temporary class (result=1)
Greetings...
I have had great success in using .net and the associated API Enterprise generated WSDL and Web Reference for about a year. I've also used the API in the Sandbox. I hadn't made a change to the Sandbox or the Production for a couple of months. Today I did the following in Firefox (I have had more success generating and downloading the WSDL in Firefox)
- Went to Settings/Develop/API/Generate Enterprise WSDL and clicked the GENERATE button to the right of "Generate Enterprise WSDL"
- The result in Firefox was not the normal formatted XML that I had seen in the past (perhaps the update to Firefox did this) What appeared was what looked like one big paragraph of sentences (no xml tags)
- I right clicked in the white area of the page and "saved as" test.wsdl
- When I opened test.wsdl, it looked like it alwas does...properly formed XML
Next in VS, I changed the Web Reference property to the Test.wsdl file name and Updated my Web Reference
======================================
Now the issue (finaly)
======================================
When I try to create an instance of SforceService like the code below:
SforceService sfService = new SforceService();
I get the following exception:
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.Name InvalidOperationException
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.Message Unable to generate a temporary class (result=1).
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.Message error CS0030: Cannot convert type 'Mozenda.Business.Salesforce.ListViewRecordColumn[]' to 'Mozenda.Business.Salesforce.ListViewRecordColumn'
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.Message error CS0030: Cannot convert type 'Mozenda.Business.Salesforce.ListViewRecordColumn[]' to 'Mozenda.Business.Salesforce.ListViewRecordColumn'
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.Message error CS0029: Cannot implicitly convert type 'Mozenda.Business.Salesforce.ListViewRecordColumn' to 'Mozenda.Business.Salesforce.ListViewRecordColumn[]'
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.Message error CS0029: Cannot implicitly convert type 'Mozenda.Business.Salesforce.ListViewRecordColumn' to 'Mozenda.Business.Salesforce.ListViewRecordColumn[]'
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.Source System.Xml
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.StackTrace at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.StackTrace at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.StackTrace at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.StackTrace at System.Xml.Serialization.XmlSerializer.GetSerializersFromCache(XmlMapping[] mappings, Type type)
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.StackTrace at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type)
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.StackTrace at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.StackTrace at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.StackTrace at Mozenda.Business.Salesforce.SforceService..ctor()
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.StackTrace at Mozenda.Business.SalesforceClient.SalesForceClient.Connect()
There is alot if information about "Unable to generate a temporary class (result=1)" doing a Google search, but nothing seems to apply.
- Has Salesforce changed how the Enterprise WSDL is created?
Thanks in advance!!
Russ
I have had great success in using .net and the associated API Enterprise generated WSDL and Web Reference for about a year. I've also used the API in the Sandbox. I hadn't made a change to the Sandbox or the Production for a couple of months. Today I did the following in Firefox (I have had more success generating and downloading the WSDL in Firefox)
- Went to Settings/Develop/API/Generate Enterprise WSDL and clicked the GENERATE button to the right of "Generate Enterprise WSDL"
- The result in Firefox was not the normal formatted XML that I had seen in the past (perhaps the update to Firefox did this) What appeared was what looked like one big paragraph of sentences (no xml tags)
- I right clicked in the white area of the page and "saved as" test.wsdl
- When I opened test.wsdl, it looked like it alwas does...properly formed XML
Next in VS, I changed the Web Reference property to the Test.wsdl file name and Updated my Web Reference
======================================
Now the issue (finaly)
======================================
When I try to create an instance of SforceService like the code below:
SforceService sfService = new SforceService();
I get the following exception:
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.Name InvalidOperationException
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.Message Unable to generate a temporary class (result=1).
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.Message error CS0030: Cannot convert type 'Mozenda.Business.Salesforce.ListViewRecordColumn[]' to 'Mozenda.Business.Salesforce.ListViewRecordColumn'
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.Message error CS0030: Cannot convert type 'Mozenda.Business.Salesforce.ListViewRecordColumn[]' to 'Mozenda.Business.Salesforce.ListViewRecordColumn'
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.Message error CS0029: Cannot implicitly convert type 'Mozenda.Business.Salesforce.ListViewRecordColumn' to 'Mozenda.Business.Salesforce.ListViewRecordColumn[]'
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.Message error CS0029: Cannot implicitly convert type 'Mozenda.Business.Salesforce.ListViewRecordColumn' to 'Mozenda.Business.Salesforce.ListViewRecordColumn[]'
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.Source System.Xml
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.StackTrace at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.StackTrace at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.StackTrace at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.StackTrace at System.Xml.Serialization.XmlSerializer.GetSerializersFromCache(XmlMapping[] mappings, Type type)
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.StackTrace at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type)
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.StackTrace at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.StackTrace at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.StackTrace at Mozenda.Business.Salesforce.SforceService..ctor()
2014-09-11 16:35:30.000 Warning SalesforceClient.Connect Exception.Exception.StackTrace at Mozenda.Business.SalesforceClient.SalesForceClient.Connect()
There is alot if information about "Unable to generate a temporary class (result=1)" doing a Google search, but nothing seems to apply.
- Has Salesforce changed how the Enterprise WSDL is created?
Thanks in advance!!
Russ
First, here is the link to the article that led to the workaround: https://connect.microsoft.com/VisualStudio/feedback/details/471297
I loaded the Reference.cs file that was created by Updating the Web Reference in Visual Studio into Notepad++ and did a search for adjacent double square brackes [][]
There were 2 lines that had the double square brackets side-by-side. I removed one of the sets, saved the .cs file and now the .net code works.
I then went into the wsdl that was generated by Salesforce and inserted a "phony" line and then updated the Web Reference in VS. The generated reference.cs file no longer had the double square brackets.
<xsd:attribute name="tmp" type="xsd:string" />
Actually this problem is started in API Version 32.
Salesforce,
Would it be possible to update the Enterprise WSDL to avoid this error in the future? Lots of devs use .NET and this is problematic to remember to edit the Enterprise WSDL every time we need to regenerate it.
Thanks in advance!
PS: Russ's link does not work for me (I do have a VS online account)
Thanks in advance for any help you can provide.
Two lots of start and end brackets, which is the equivalent of [] in c#
Cheers
Brian
I was highlight/copy/pasting the XML into a text editor and saving. This caused issues in the XML WSDL (yet I am sure I did a full highlight & copy)
But selecting File -> Save Page As saved the file correctly
FYI - You still need to add the xml string to the Enterprise.WSDL.XML file as explained above by Russ Young: In this section of Enterprise.WSDL.XML. Search on name="ListViewRecord" to easily find the section: Enjoy
So is there no way to generate the wsdl without having to modify it? Not that I'm aware of.
Does it always require the extra xsd line mentioned above to prevent the double brackets? Yes
So Salesforce says they cannot fix the issue with .NET. I tried finding the bug report that noted this but couldn't find it again... if someone does please post a link here.
Additionally Microsoft built and defines the frameworks capabilties, so developers who want to use Microsoft's framework must comply with their Framework requirements. It is not on us to resolve framework requirements.
It clearly says that the type conversion they are attempting can not be done.
https://gist.github.com/tomfanning/cfc6cc11595fd60528ed
Enjoy.
Thanks for the solution, how did you ever work that out!
It was necessary only to update the Reference.cs file, as you said.
https://stackoverflow.com/questions/5595779/xmlserializer-invalidoperationexc-known-issue-converting-types
ListViewRecordColumn is affected in Enterprise WSDL
QuickActionLayoutItem and NavigationMenuItem is affected in Metadata WSDL
QuickActionLayoutItem and NavigationMenuItem is affected in Tooling WSDL