11.07.2015 Views

y - Net Developer

y - Net Developer

y - Net Developer

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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

amrameshreddy.blog.com174 CHAPTER 5 ■ HOSTING AND CONSUMING WCF SERVICESramrameshreddy.blog.com[GeneratedCode("System.ServiceModel", "3.0.0.0")]public interface ITradeServiceChannel : ITradeService, IClientChannel{}[GeneratedCode("System.ServiceModel", "3.0.0.0")]public partial class TradeServiceClient : ClientBase, ITradeService{// Left out some constructors in printed code, see sample code}public SimpleClientWithProxy.ExchangeService.QuoteGetQuote(string ticker){return base.Channel.GetQuote(ticker);}public void PublishQuote(SimpleClientWithProxy.ExchangeService.Quote quote){base.Channel.PublishQuote(quote);}Using Visual Studio 2005Similar to ASP.NET proxy creation, if you right-click the project from the IDE, you’ll see threeoptions for adding references, as shown in Figure 5-17.Figure 5-17. Adding a reference to a WCF serviceramrameshreddyramrameshreddyThe option you’re looking for is Add Service Reference. This menu option is a wrapperaround the SvcUtil.exe utility (which is explained in the next section), actually spawning aprocess with the necessary parameters. Once you’ve selected Add Service Reference, you’ll seethe dialog box shown in Figure 5-18.

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

Saved successfully!

Ooh no, something went wrong!