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.

amrameshreddy.blog.com138 CHAPTER 4 ■ INSTALLING AND CREATING WCF SERVICESramrameshreddy.blog.comapplying policies and rules based upon the content of the SOAP request. If you can promoteor present some attribute of the request to the SOAP header, it’s easily validated before anydownstream code processes the request in your service implementation.If you take a look at the Trade class in Listing 4-25 (part of the accompanying code inExample09), you can see that it has been updated with a specific namespace in addition tobeing decorated with the DataMember attribute with a mix of fields and properties. Additionally,the Execution class, shown in Listing 4-26, has been similarly decorated.Listing 4-25. Trade Data Contract (Partial)namespace ExchangeService{[DataContract(Namespace = "http://PracticalWcf/Exchange/Trade" )]public class Trade{string _ticker;char _type;string _publisher;[DataMember(Name = "Participant", IsRequired = true, Order = 0 )]string _participant;[DataMember(Name = "QuotedPrice", IsRequired = false, Order = 1 )]internal double _quotedPrice;[DataMember(Name = "Quantity", IsRequired = true, Order = 1 )]private int _quantity;[DataMember(Name = "TradeTime", IsRequired = false, Order = 9 )]Nullable _tradeTime;double _executionAmount;/// /// Primary exchange security identifier/// [DataMember( IsRequired = true, Order = 3 )]public string Ticker{get { return _ticker; }set { _ticker = value; }}ramrameshreddyramrameshreddy

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

Saved successfully!

Ooh no, something went wrong!