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 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; }
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); }
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); }
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; }