11.07.2015 Views

y - Net Developer

y - Net Developer

y - Net Developer

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 3 ■ EXPLORING THE WCF PROGRAMMING MODEL 77ramrameshreddy.blog.comnamespace QuickReturns.StockTrading.ExchangeService.Clients{[ServiceContract(Namespace = "http://QuickReturns")]interface ITradeService{[OperationContract()]Quote GetQuote(string ticker);}[OperationContract()]void PublishQuote(Quote quote);[DataContract(Namespace = "http://QuickReturns", Name = "Quote")]public class Quote{[DataMember(Name = "Ticker")]public string Ticker;}[DataMember(Name = "Bid")]public decimal Bid;[DataMember(Name = "Ask")]public decimal Ask;[DataMember(Name = "Publisher")]public string Publisher;[DataMember(Name = "UpdateDateTime")]private DateTime UpdateDateTime;class ExchangeServiceSimpleClient{static void Main(string[] args){EndpointAddress address =new EndpointAddress("http://localhost:8080/QuickReturns/Exchange");BasicHttpBinding binding = new BasicHttpBinding();IChannelFactory channelFactory =new ChannelFactory(binding);ITradeService proxy = channelFactory.CreateChannel(address);ramrameshreddyramrameshreddy

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!