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.comThe reliableSession element shown in Listing 13-13 enables WS-ReliableMessagingon all the service interface interactions that leverage WSHttpBinding. Note that theestablishSecurityContext attribute is set to true (the default) for the binding. At thistime, WCF requires a combination of WS-Security with reliable sessions. If you set theestablishSecurityContext attribute to false, when starting the host, you will receive aSystem.InvalidOperation exception with the message “{"Cannot establish reliable sessionwithout secure conversation. Enable secure conversation."}.”Keeping with the WCF core ability to support both a declarative and a programmaticdrivenimplementation, it is also possible via code to enable reliable sessions, as shown inListing 13-14.Listing 13-14. WS-ReliableMessaging Using CodeWSHttpBinding binding =new WSHttpBinding( SecurityMode.Message, true );myServiceHost.AddServiceEndpoint(typeof( IFileService),binding,baseAddress);The code in Listing 13-14 uses the WSHttpBinding constructor override that accepts aSecurityMode value along with a Boolean value that enables reliable sessions on the binding.An alternate override is to specify a configuration name, which allows a mix of a programmatic-drivenapproach and a configuration-driven approach to development.If you examine the HTTP traffic for the service exchange, you now see an overall increase(doubling) of the request-reply between the client and server for the same service interface call.What is happening is that with each request, additional acknowledgment messages are indicatingsuccess on each message. These additional messages are the delivery assurance mechanism aspart of WS-ReliableMessaging. An example of one of these messages is contained in the \Capturedirectory as the file Ack.txt. This message contains the CreateSequenceResponse as a reply to aninitial CreateSequence initiation that establishes the reliable session. The full Ethereal capture ispresent in the file wsrm.log in the \Capture directory. You can find full details of the exchange ofmessages in section 2.4 of the WS-ReliableMessaging specification. 28Platform Support of WS-ReliableMessagingCHAPTER 13 ■ IMPLEMENTING SOA INTEROPERABILITY 421Industry and platform support of WS-ReliableMessaging is a critical aspect of overall web serviceadoption in the enterprise. Prior to web services, applications were coupled using varied means,with some being file based and many using queued messaging technologies such as MQSeriesor Tibco. Most of the time, the coupling was tighter than ideal.As web services became more prevalent, the desire to connect systems both within anenterprise and outside the firewall has been a critical success factor to the technologies’ overalladoption. However, the reliability of the underlying protocol, primarily HTTP, has left it forlow-value and low-risk scenarios.ramrameshreddyramrameshreddy28. You can find Shy Cohen's blog about demystifying reliable messaging at http://blogs.msdn.com/shycohen/archive/2006/02/20/535717.aspx.

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

Saved successfully!

Ooh no, something went wrong!