Esempio n. 1
0
        private byte[] Serialise(XsdNs.ParameterDataType proxy)
        {
            // Using "submit" request as the wrapper
            var xmlDocProxy = new XsdNs.SubmitType()
            {
                service           = "SPS",
                version           = "2.0.0",
                procedure         = "my-procedure",
                taskingParameters = new XsdNs.TaskingRequestTypeTaskingParameters()
                {
                    ParameterData = proxy
                }
            };

            return(XNeut.Helper.ToXmlBytes(xmlDocProxy));
        }
Esempio n. 2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="proxy">Proxy with parameter data.</param>
        /// <exception cref="XNeut.InvalidMessageException">Thrown if an error is encountered.</exception>
        public TaskingParameterProcessor(XsdNs.ParameterDataType proxy)
        {
            // Setting defaults
            Parameters = new Item_DataRecord();

            // Parameters defined in the proxy?
            // The values are mandatory but, for robustness, just skipping if empty
            if (proxy.values != null)
            {
                // Reading parameters; expecting a data record
                if (!(proxy.values is XsdNs.DataRecordPropertyType paramProxy))
                {
                    throw new XNeut.InvalidMessageException("Unexpected type of tasking parameters; expected swe:DataRecord");
                }
                else
                {
                    Parameters = new Item_DataRecord(paramProxy);
                }
            }