rickgaribay.net

Space shuttles aren't built for rocket scientists, they're built for astronauts. The goal isn't the ship, its the moon.
posts - 258, comments - 163, trackbacks - 28

My Links

News

Where's Rick?



Visual Studio Connections, 3/26

That Conference, 8/13



About Me
I am a developer, architect, writer and speaker, passionate about distributed .NET technologies and Application Lifecycle Management. I am currently the General Manager of the Connected Systems Practice at Neudesic.


    follow me on Twitter



    Archives

    Post Categories

    Published Works

    BizTalk Messages & Generic Collections

    It appears that the BizTalk compiler has a problem with generic types.

    When using the generic List<T> for a collection of .NET types, the class library (or course) compiles fine. The code looks something like this:

    using System;
    using System.Collections.Generic;
    using System.Text;
    using Microsoft.XLANGs.BaseTypes;
     
     
     
    namespace Northwind.BusinessEntities.RetailOps
    {
        [Serializable]
        public class PurchaseOrder
        {
            private int m_PurchaseOrderId;
            private string m_FirstName;
            private string m_LastName;
            private string m_ShippingAddressLine1;
            private string m_ShippingAddressLine2;
            private string m_ShippingState;
            private int m_ShippingZipCode;
            private int m_AccountNumber;
            private string m_Expiry;
            private InventoryItem[] m_Items;
     
           
           
            public InventoryItem[] Items
            {
                get
                {
                    return m_Items;
                }
                set
                {
                    m_Items = value;
                }
            }

    When compiling a BTS 2006 project, however, the compiler barks with a very helpful (not!) exception: Unknown Exception.

    Interestingly, changing the m_Items type from a generic List<T> to a plain ol array appeases the BizTalk gods:

     
            private InventoryItem[] m_Items;
           
            public InventoryItem[] Items
            {
                get
                {
                    return m_Items;
                }
                set
                {
                    m_Items = value;
                }
            }

    Surprisingly, both collections produce identical XSD:

          <xs:element minOccurs="0" maxOccurs="1" name="Items" type="ArrayOfInventoryItem" />

    It would definetely be nice if generic collections were supported in the next version of BTS. This is a key feature that is prevelant in C# classes and not including support for it will result in un-natural programming techniques that will only build technology debt.

    Print | posted on Tuesday, October 24, 2006 3:52 PM |

    Feedback

    Gravatar

    # re: BizTalk Messages &amp; Generic Collections

    11/14/2006 9:17 PM | peter kiesewetter
    Comments have been closed on this topic.

    Powered by: