/// <summary>
        /// Creates a response message ready to be transmitted back to the terminal.
        /// </summary>
        /// <param name="sourceMsg">The source message containing the receive Uri.</param>
        /// <returns>A <see cref="VocollectMessage"/> object.</returns>
        protected static MultiPartMessage CreateResponseMessage(MultiPartMessage sourceMsg)
        {
            MultiPartMessage msg = new VocollectMessage();

            sourceMsg.Metadata.Copy("ReceiveUri", msg.Metadata);
            msg.Metadata.Write("Loopback", true);

            return(msg);
        }
        /// <summary>
        /// Creates a request message ready to be transmitted to the WMS.
        /// </summary>
        /// <param name="packageName">Package name.</param>
        /// <param name="procedureName">Name of stored procedure to call.</param>
        /// <param name="session">The current <see cref="VocollectSession"/> object.</param>
        /// <returns>A <see cref="MultiPartMessage"/> that can be sent to the WMS.</returns>
        protected static MultiPartMessage CreateRequestMessage(string packageName, string procedureName, VocollectSession session)
        {
            MultiPartMessage msg = new VocollectMessage();

            VocollectSection configSection = ConfigurationManager.GetSection(VocollectSection.SectionKey) as VocollectSection;

            msg.Metadata.Write("SendUri", new Uri(string.Format("warehouse://{2}/{0}/{1}", packageName, procedureName, configSection.Database)));

            if (session != null)
            {
                msg.Metadata.Write("LanguageCode", session.ReadAsString("NLANGCOD"));
            }

            return(msg);
        }