none
Unable to generate a temporary class (result=1).error CS0030: Cannot convert type RRS feed

  • Question

  • Exposed Biztalk Schema As WCF service.

    Service is brow sable but when when i am trying to consume from WCF strom(Services Testing tool) it is showing the above error.

    It is able to create Proxy but not able to send request.

    please help me to solve this issue.


    Friday, November 6, 2015 9:54 AM

Answers

  • Hi,

    Thank you for posting in MSDN forum.

    When you execute the Invoke Web Services object in Microsoft System Center Orchestrator or Opalis Integration Server, you receive one or more of the following errors in the "Error Summary Text" published data:

    Unable to generate a temporary class (result=1).
    error CS0030: Cannot implicitly convert type 'Opalis.WebServices.DynamicProxy.CustomType[]' to 'Opalis.WebServices.DynamicProxy.CustomType'

    Cause:

    A known issue with WSDL.exe can cause a proxy class to be generated incorrectly if an array of complex type includes an element that is also an array of complex type and for which only one element exists.

    Note WSDL.exe is included in the Microsoft .NET Framework.

    Resolution:

    There is no resolution available at this point. However, three workarounds are available:
    You can generate the proxy class manually by using WSDL.exe and then change the proxy class in which the data type was inappropriately created as a two-dimensional array (for example, "CustomType[][]") so that it is a single-dimensional array (for example, "CustomType[]").
    You can change the data type in the desired Web Services Description Language (WSDL) so that a second, optional element is included in the definition. You can do this by adding an element such as the following: 
    <xs:element minOccurs="0" name="dummyElement" nillable="true" type="xs:string"/> 
    You can change the complex type in the desired WSDL so that the boundary attributes are part of the complex type instead of being part of the element. (That is, you can move the minOccurs and maxOccurs attributes to the complex type and then remove them from the element.)

    Reference: Unable to generate a temporary class (result=1)


    Thanks, If my reply is helpful please mark as answer or vote as helpful.

    Friday, November 6, 2015 9:59 PM

All replies

  • Where are you seeing this error?  In the client tool or in BizTalk?
    Friday, November 6, 2015 12:51 PM
  • Hi ,

    Are you using any complex type as datatype in any of the field?

    I would suggest to look into below MSDN post

    https://support.microsoft.com/en-us/kb/2486643

    Also have you tried the service through SOAP UI ? Is it generating correct WSDL


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply

    • Proposed as answer by Derek Gary Monday, January 25, 2016 10:50 PM
    Friday, November 6, 2015 1:18 PM
  • Hi,

    Thank you for posting in MSDN forum.

    When you execute the Invoke Web Services object in Microsoft System Center Orchestrator or Opalis Integration Server, you receive one or more of the following errors in the "Error Summary Text" published data:

    Unable to generate a temporary class (result=1).
    error CS0030: Cannot implicitly convert type 'Opalis.WebServices.DynamicProxy.CustomType[]' to 'Opalis.WebServices.DynamicProxy.CustomType'

    Cause:

    A known issue with WSDL.exe can cause a proxy class to be generated incorrectly if an array of complex type includes an element that is also an array of complex type and for which only one element exists.

    Note WSDL.exe is included in the Microsoft .NET Framework.

    Resolution:

    There is no resolution available at this point. However, three workarounds are available:
    You can generate the proxy class manually by using WSDL.exe and then change the proxy class in which the data type was inappropriately created as a two-dimensional array (for example, "CustomType[][]") so that it is a single-dimensional array (for example, "CustomType[]").
    You can change the data type in the desired Web Services Description Language (WSDL) so that a second, optional element is included in the definition. You can do this by adding an element such as the following: 
    <xs:element minOccurs="0" name="dummyElement" nillable="true" type="xs:string"/> 
    You can change the complex type in the desired WSDL so that the boundary attributes are part of the complex type instead of being part of the element. (That is, you can move the minOccurs and maxOccurs attributes to the complex type and then remove them from the element.)

    Reference: Unable to generate a temporary class (result=1)


    Thanks, If my reply is helpful please mark as answer or vote as helpful.

    Friday, November 6, 2015 9:59 PM
  • I had the same trouble.

    I generated some code with xsd.exe.  It had a piece that looked like this:

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
    public partial class ResultsRow {
        
        private ResultsRowIDictKVP[][] iDictField;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
        [System.Xml.Serialization.XmlArrayItemAttribute("KVP", typeof(ResultsRowIDictKVP), Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
        public ResultsRowIDictKVP[][] iDict {
            get {
                return this.iDictField;
            }
            set {
                this.iDictField = value;
            }
        }
    }
    

    The trouble was the double [][].

    So, I hacked out the extra [], and it serialized just fine.  It would seem there is a bug in XSD.EXE, and when it generates double brackets, i.e. [][], it really should have just made a single brackets, i.e. []

    • Proposed as answer by JerryMLaGrou Friday, April 6, 2018 4:04 PM
    Friday, April 6, 2018 4:04 PM