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.com44 CHAPTER 2 ■ INTRODUCING WCF BASICSramrameshreddy.blog.comUnifying Distributed TechnologiesMany of the features in WCF have their deep roots in a number of technologies such as ASMX,Enterprise Services, .NET Remoting, MSMQ, and WSE. Though this book won’t cover all thesetechnologies, it’s always good to take a sneak peek at each of these to get a better understandingof WCF.ASMXA web service is a component on the Web that is accessible through open standards such asSOAP and HTTP. Accessing a remote component is not a new concept. It was previously accomplishedthrough RMI, CORBA, and DCOM. But these distributed components are based onproprietary standards or protocols. Earlier distributed technologies had two main problems:• Interoperability• Crossing firewallsThese proprietary standards cannot interoperate with each other because they have theirown binary standards and protocols. Additionally, they send binary messages through a nonstandardport that results in creating “holes” in corporate firewalls. Web services deviate fromall these issues by relying on web standards or protocols instead of relying on proprietary protocols.Web services are based on the notion of a service and transfer the data in messages.A web service is a class that inherits from System.Web.Services.WebService and containsthe method to be exposed with the [WebMethod] attribute over it. Listing 2-1 contains a classnamed Employee that has two public methods named Gand so onustomer and DeleteCustomer.The method name Gand so onustomer will be consumed only as web service methods becauseit has been decorated with the [WebMethod] attribute.Listing 2-1. Sample XML Web Service Classusing System;using System.Collections;using System.ComponentModel;using System.Data;using System.Diagnostics;using System.Web;using System.Web.Services;namespace Order{public class Employee : WebService{[WebMethod()]public DataSet Gand so onustomer(int CustomerID){// logic to retrieve customer}ramrameshreddyramrameshreddy

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

Saved successfully!

Ooh no, something went wrong!