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 - 303, comments - 180, trackbacks - 35

My Links

News

Where's Rick?


AgileAlliance deliver:Agile 2019- 4/29
Desert Code Camp, PHX - 10/11
VS Live Austin, TX - 6/3
VS Live SF - 6/17


About Me
Hands on leader, developer, architect specializing in the design and delivery of distributed systems in lean, agile environments with an emphasis in continuous improvement across people, process and technology. Speaker and published author with 18 years' experience leading the delivery of large and/or complex, high-impact distributed solutions in Retail, Intelligent Transportation, and Gaming & Hospitality.

I'm currently a Principal Engineer at Amazon, within the North America Consumer organization leading our global listings strategy that enable bulk and non-bulk listing experiences for our WW Selling Partners via apps, devices and APIs.

Full bio

Note: All postings on this site are my own and don’t necessarily represent the views of my employer.



Check out my publications on Amazon Kindle!





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: