gov.va.medora.mdo.dao.vista.VistaQuery.buildMessage_NatBroker C# (CSharp) Method

buildMessage_NatBroker() private method

private buildMessage_NatBroker ( ) : string
return string
        internal string buildMessage_NatBroker()
        {
            const string PREFIX = "[XWB]";
            const int COUNT_WIDTH = 3;
            const string RPC_VERSION = "1.108";

            string sParams = "5";           // Don't ask my why - from the broker code

            for (int i = 0; i < parameters.Count; i++)
            {
                Parameter vp = (Parameter)parameters[i];
                int pType = vp.Type;
                if (pType == LITERAL)
                {
                    sParams += '0' + StringUtils.LPack(vp.Value, COUNT_WIDTH) + 'f';
                }
                else if (pType == REFERENCE)
                {
                    sParams += '1' + StringUtils.LPack(vp.Value, COUNT_WIDTH) + 'f';
                }
                //else if (pType == EMPTY)
                //{
                //    sParams += "4f";
                //}
                else if (pType == LIST)
                {
                    sParams += '2' + list2string(vp.List);
                }
                //else if (pType == GLOBAL)
                //{
                //    sParams += '3' + list2string(vp.List);
                //}
                //else if (pType == STREAM)
                //{
                //    sParams += '5' + StringUtils.LPack(vp.Value, COUNT_WIDTH) + 'f';
                //}
            }
            string msg = "";

            // More inscrutable ugliness from the Delphi broker
            if (sParams == "5")
            {
                sParams += "4f";
            }

            msg = PREFIX + "11" + Convert.ToString(COUNT_WIDTH) + "02" + StringUtils.SPack(RPC_VERSION) +
                StringUtils.SPack(rpcName) + sParams + '\x0004';
            return msg;
        }