示例#1
0
        public static XmlDictionaryReader SetupMessageContractTests(bool isWrapped)
        {
            MyInspector      inspector = new MyInspector();
            BasicHttpBinding binding   = new BasicHttpBinding();
            ChannelFactory <IMessageContract> factory = new ChannelFactory <IMessageContract>(binding, new EndpointAddress(Endpoints.HttpBaseAddress_Basic));

            factory.Endpoint.EndpointBehaviors.Add(inspector);
            IMessageContract clientProxy = factory.CreateChannel();

            MessageContractTypes.RequestBankingData transaction = new MessageContractTypes.RequestBankingData();
            transaction.accountName     = MessageContractConstants.customerElementValue;
            transaction.transactionDate = DateTime.Now;
            MessageContractConstants.dateElementValue = transaction.transactionDate.TimeOfDay.ToString();
            transaction.amount = Convert.ToInt32(MessageContractConstants.transactionElementValue);

            if (isWrapped)
            {
                MessageContractTypes.ReplyBankingData responseData = clientProxy.MessageContractRequestReply(transaction);
            }
            else
            {
                MessageContractTypes.ReplyBankingDataNotWrapped responseData = clientProxy.MessageContractRequestReplyNotWrapped(transaction);
            }

            XmlDictionaryReader reader = inspector.ReceivedMessage.GetReaderAtBodyContents();

            return(reader);
        }
示例#2
0
        public static XmlDictionaryReader SetupMessageContractTests(bool isWrapped)
        {
            MyInspector inspector = new MyInspector();
            BasicHttpBinding binding = new BasicHttpBinding();
            ChannelFactory<IMessageContract> factory = new ChannelFactory<IMessageContract>(binding, new EndpointAddress(Endpoints.HttpBaseAddress_Basic));
            factory.Endpoint.EndpointBehaviors.Add(inspector);
            IMessageContract clientProxy = factory.CreateChannel();
            MessageContractTypes.RequestBankingData transaction = new MessageContractTypes.RequestBankingData();
            transaction.accountName = MessageContractConstants.customerElementValue;
            transaction.transactionDate = DateTime.Now;
            MessageContractConstants.dateElementValue = transaction.transactionDate.TimeOfDay.ToString();
            transaction.amount = Convert.ToInt32(MessageContractConstants.transactionElementValue);

            if (isWrapped)
            {
                MessageContractTypes.ReplyBankingData responseData = clientProxy.MessageContractRequestReply(transaction);
            }
            else
            {
                MessageContractTypes.ReplyBankingDataNotWrapped responseData = clientProxy.MessageContractRequestReplyNotWrapped(transaction);
            }

            XmlDictionaryReader reader = inspector.ReceivedMessage.GetReaderAtBodyContents();
            return reader;
        }
        public static MyInspector SetupMessageContractTests(out IMessageContract clientProxy,
            out MessageContractTypes.RequestBankingData transaction)
        {
            MyInspector inspector = new MyInspector();
            BasicHttpBinding binding = new BasicHttpBinding();
            ChannelFactory<IMessageContract> factory = new ChannelFactory<IMessageContract>(binding, new EndpointAddress(Endpoints.HttpBaseAddress_Basic));
            factory.Endpoint.EndpointBehaviors.Add(inspector);
            clientProxy = factory.CreateChannel();
            transaction = new MessageContractTypes.RequestBankingData();
            transaction.accountName = MessageContractConstants.customerElementValue;
            transaction.transactionDate = DateTime.Now;
            MessageContractConstants.dateElementValue = transaction.transactionDate.TimeOfDay.ToString();
            transaction.amount = Convert.ToInt32(MessageContractConstants.transactionElementValue);

            return inspector;
        }
示例#4
0
        public static MyInspector SetupMessageContractTests(out IMessageContract clientProxy,
                                                            out MessageContractTypes.RequestBankingData transaction)
        {
            MyInspector      inspector = new MyInspector();
            BasicHttpBinding binding   = new BasicHttpBinding();
            ChannelFactory <IMessageContract> factory = new ChannelFactory <IMessageContract>(binding, new EndpointAddress(Endpoints.HttpBaseAddress_Basic));

            factory.Endpoint.EndpointBehaviors.Add(inspector);
            clientProxy                 = factory.CreateChannel();
            transaction                 = new MessageContractTypes.RequestBankingData();
            transaction.accountName     = MessageContractConstants.customerElementValue;
            transaction.transactionDate = DateTime.Now;
            MessageContractConstants.dateElementValue = transaction.transactionDate.TimeOfDay.ToString();
            transaction.amount = Convert.ToInt32(MessageContractConstants.transactionElementValue);

            return(inspector);
        }
示例#5
0
        public static MessageHeaders GetHeaders(MyInspector inspector)
        {
            MessageHeaders headers = inspector.ReceivedMessage.Headers;

            return(headers);
        }
示例#6
0
        public static XmlDictionaryReader GetResponseBodyReader(MyInspector inspector)
        {
            XmlDictionaryReader reader = inspector.ReceivedMessage.GetReaderAtBodyContents();

            return(reader);
        }
 public static MessageHeaders GetHeaders(MyInspector inspector)
 {
     MessageHeaders headers = inspector.ReceivedMessage.Headers;
     return headers;
 }
 public static XmlDictionaryReader GetResponseBodyReader(MyInspector inspector)
 {
     XmlDictionaryReader reader = inspector.ReceivedMessage.GetReaderAtBodyContents();
     return reader;
 }