Inheritance: IDispatchMessageFormatter, IClientMessageFormatter
コード例 #1
0
ファイル: BaseMessagesFormatter.cs プロジェクト: zzwwqqq/mono
        public OperationFormatter(OperationDescription od, bool isRpc, bool isEncoded)
        {
            Validate(od, isRpc, isEncoded);

            impl = BaseMessagesFormatter.Create(od);

            operation_name = od.Name;
        }
コード例 #2
0
ファイル: BaseMessagesFormatter.cs プロジェクト: nekresh/mono
		public OperationFormatter (OperationDescription od, bool isRpc, bool isEncoded)
		{
			Validate (od, isRpc, isEncoded);

			impl = BaseMessagesFormatter.Create (od);

			operation_name = od.Name;
		}
コード例 #3
0
 internal IDispatchMessageFormatter GetFormatter()
 {
     if (actual_formatter == null)
     {
         if (Formatter != null)
         {
             actual_formatter = Formatter;
         }
         else
         {
             actual_formatter = BaseMessagesFormatter.Create(Description);
         }
     }
     return(actual_formatter);
 }
コード例 #4
0
ファイル: EndpointDispatcher.cs プロジェクト: raj581/Marvin
        void PopulateDispatchOperation(DispatchRuntime db, OperationDescription od)
        {
            string reqA = null, resA = null;

            foreach (MessageDescription m in od.Messages)
            {
                if (m.Direction == MessageDirection.Input)
                {
                    reqA = m.Action;
                }
                else
                {
                    resA = m.Action;
                }
            }
            DispatchOperation o =
                od.IsOneWay ?
                new DispatchOperation(db, od.Name, reqA) :
                new DispatchOperation(db, od.Name, reqA, resA);
            bool no_serialized_reply = od.IsOneWay;

            foreach (MessageDescription md in od.Messages)
            {
                if (md.Direction == MessageDirection.Input &&
                    md.Body.Parts.Count == 1 &&
                    md.Body.Parts [0].Type == typeof(Message))
                {
                    o.DeserializeRequest = false;
                }
                if (md.Direction == MessageDirection.Output &&
                    md.Body.ReturnValue != null)
                {
                    if (md.Body.ReturnValue.Type == typeof(Message))
                    {
                        o.SerializeReply = false;
                    }
                    else if (md.Body.ReturnValue.Type == typeof(void))
                    {
                        no_serialized_reply = true;
                    }
                }
            }

            // Setup Invoker
            o.Invoker = new DefaultOperationInvoker(od);

            // Setup Formater
            o.Formatter = BaseMessagesFormatter.Create(od);

            if (o.Action == "*" && (o.IsOneWay || o.ReplyAction == "*"))
            {
                //Signature : Message  (Message)
                //	    : void  (Message)
                //FIXME: void (IChannel)
                if (!o.DeserializeRequest && (!o.SerializeReply || no_serialized_reply))                 // what is this double-ish check for?
                {
                    db.UnhandledDispatchOperation = o;
                }
            }

            db.Operations.Add(o);
        }