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.com216 CHAPTER 7 ■ IMPLEMENTING WCF SECURITYramrameshreddy.blog.comdesigned to support interoperable scenarios with other platforms. Therefore, it does not implementsecurity by default. (However, you can extend this binding to implement security byutilizing custom code.) You need to utilize WsHttpBinding or WsDualHttpBinding to implementsecurity.■Note Please consult Chapter 3 for an extensive discussion of bindings. This chapter will concentrateonly on the security implications and extensions of bindings. However, it is important to note that the binaryencodedbindings (that is, <strong>Net</strong>*Binding) require WCF on both the sender and the receiver ends because ofoptimization and performance reasons. <strong>Net</strong>MsmqBinding is used for asynchronous scenarios.<strong>Net</strong>TcpBinding and <strong>Net</strong>NamedPipeBinding support reliable sessions and transactions.You can also build your custom binding by utilizing the System.ServiceModel.Channelsnamespace. You can define security features, encoding, and serialization options that are suitableto your requirements using the classes available in this namespace. Similarly, you canalso utilize the ProtectionLevel binding property to enforce integrity and confidentiality. Theoptions available for the ProtectionLevel property are as follows:None: Only authenticate the binding.Sign: Ensure integrity in the transmitted data.EncryptAndSign: Ensure both confidentially and integrity.Protection LevelsWCF security encrypts and signs the messages by default. This could lead to “overkill” in someinstances. Therefore, you can implement integrity where confidentiality is not a requirement(such as when debugging code by developers). In such cases, WCF provides the facility to setthe protection level on the message. The following application file snippet illustrates how toachieve this using configuration files; the messages are required to be signed only before theyare sent:ramrameshreddyramrameshreddyMessage exchange patterns (MEPs) determine how the messages are sent from the senderto the receiver. How are these message patterns implemented in WCF? Can you implement securityon all these bindings for one-way and request-reply patterns? WCF does implement security

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

Saved successfully!

Ooh no, something went wrong!