Ejemplo n.º 1
0
        private string TestTran(string input, AHostCommand HC)
        {
            MessageResponse retMsg;

            Message.Message msg = new Message.Message(input);

            string trailingChars = "";

            if (ExpectTrailers())
            {
                trailingChars = msg.GetTrailers();
            }

            HC.AcceptMessage(msg);

            if (HC.XMLParseResult != ErrorCodes.ER_00_NO_ERROR)
            {
                retMsg = new MessageResponse();
                retMsg.AddElement(HC.XMLParseResult);
            }
            else
            {
                retMsg = HC.ConstructResponse();
            }

            retMsg.AddElement(trailingChars);

            HC.Terminate();
            HC = null;
            return(retMsg.MessageData);
        }
Ejemplo n.º 2
0
        private string TestMessage(string message, AHostCommand command)
        {
            var msg = new StreamMessage(message);

            command.AcceptMessage(msg);
            if (command.XmlParseResult != ErrorCodes.ER_00_NO_ERROR)
            {
                return(command.XmlParseResult);
            }

            var rsp = command.ConstructResponse();

            return(rsp.GetBytes().GetString());
        }
Ejemplo n.º 3
0
        private void TestMessageWithIo(string message, AHostCommand command, out string rsp, out string rspAfterIo)
        {
            var msg = new StreamMessage(message);

            command.AcceptMessage(msg);
            if (command.XmlParseResult != ErrorCodes.ER_00_NO_ERROR)
            {
                rsp        = command.XmlParseResult;
                rspAfterIo = string.Empty;
                return;
            }

            rsp = command.ConstructResponse().Message;

            rspAfterIo = command.ConstructResponseAfterIo().Message;
        }