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 2 ■ INTRODUCING WCF BASICS 45ramrameshreddy.blog.com}}public DataSet DeleteCustomer(int CustomerID){// logic to delete Orders of a customer}To access any remote components, you need a transport protocol, a message protocol,and the serialization mechanism for a client and server. In web services, the transport protocolis mainly HTTP, though it can be SMTP or TCP as well. As far as a message protocol isconcerned, SOAP is the preferred and default message protocol. It also supports HTTP GET orHTTP POST. XML web services use XML serialization.The following are the problems with ASMX:• An ASMX page contains a complete set of information that describes how the data willbe formatted, how to wrap the data in a SOAP header, and how to prepare it to be sent.However, it doesn’t tell you how to deliver it over the transports and to use a specifictype of security. All of those transport-oriented notions are missing from today’s ASMXservices, and this is something that WCF enhances quite significantly.• Another limitation of ASMX is the tight coupling with the HTTP runtime and thedependence on IIS to host it. This problem is solved by WCF, which can be hosted byany Windows process that is able to host the .NET Framework 3.0.• ASMX service is instantiated on a per-call basis, while WCF gives you flexibility by providingvarious instancing options such as Singleton, private session, per call. (Wediscuss these in detail in Chapter 4.)• ASMX provides the way for interoperability but doesn’t fulfill some of the basic requirements;for example, it does not provide or guarantee end-to-end security or reliablecommunication.MSMQDistributed systems have been built for many years by using synchronous RPCs. This meansthe sender application must be online during each request while the receiver carries out therequested task. The receiver must be online for the sender to make requests, and the sendermust be online to issue requests. In other words, both the sender and receiver need to beonline to make the task operational. Some applications (especially ones supporting disconnectedenvironments) need to communicate in an asynchronous manner. Asynchronousbasedcommunication through messages has become one of the alternatives in distributedcomputing. In this communication model, the client begins the process by sending messagesand then continues doing other work or even goes offline without waiting for the operation tocomplete. If the receiver is offline, the entire request from the sender gets stored in queues.Once the receiver is ready, it can consume the messages from the queue and do the necessaryoperations on it. The best advantage is that the sender and receiver do not need to be availableat the same time. It also ensures the reliable delivery of messages in a loosely coupledenvironment.ramrameshreddyramrameshreddy

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

Saved successfully!

Ooh no, something went wrong!