What is Web Service?
Web Service is an application that is designed to interact directly with other applications over the internet. In simple sense, Web Services are means for interacting with objects over the Internet. The Web serivce consumers are able to invoke method calls on remote objects by using SOAP and HTTP over the Web. WebService is language independent and Web Services communicate by using standard web protocols and data formats, such as HTTP, XML and SOAP.
What is WCF (windows communication foundation) Service?
Windows Communication Foundation (Code named Indigo) is a programming platform and runtime system for building, configuring and deploying network-distributed services. It is the latest service oriented technology; Interoperability is the fundamental characteristics of WCF. It is unified programming model provided in .Net Framework 3.0. WCF is a combined feature of Web Service, Remoting, MSMQ and COM+. WCF provides a common platform for all .NET communication.
Web Service vs. WCF Service
1. Web service is there with .net framework from version 1.0. Whereas, WCF service got introduced with .NET 3.0.
2. ASP.NET Web services send and receive messages by using SOAP over HTTP or HTTPS.
3. Web services have “.asmx” extension, whereas Wcf services have “.svc” extension.
4. The asmx page uses “WebService” directive where as the svc page uses “ServiceHost” directive.
5. ASP.NET Web services rely on the XmlSerializer in System.XML.Serialization namespace for serialization (to translate data in .NET Framework types to XML and vice versa for transmission to or from a service). XmlSerializer has some limitations like:
Some more Differences between WCF and Web service
Web service is a part of WCF. WCF offers much more flexibility and portability to develop a service when comparing to web service. Still we are having more advantages over Web service; following table provides detailed difference between them.
Web Service is an application that is designed to interact directly with other applications over the internet. In simple sense, Web Services are means for interacting with objects over the Internet. The Web serivce consumers are able to invoke method calls on remote objects by using SOAP and HTTP over the Web. WebService is language independent and Web Services communicate by using standard web protocols and data formats, such as HTTP, XML and SOAP.
What is WCF (windows communication foundation) Service?
Windows Communication Foundation (Code named Indigo) is a programming platform and runtime system for building, configuring and deploying network-distributed services. It is the latest service oriented technology; Interoperability is the fundamental characteristics of WCF. It is unified programming model provided in .Net Framework 3.0. WCF is a combined feature of Web Service, Remoting, MSMQ and COM+. WCF provides a common platform for all .NET communication.
Web Service vs. WCF Service
1. Web service is there with .net framework from version 1.0. Whereas, WCF service got introduced with .NET 3.0.
2. ASP.NET Web services send and receive messages by using SOAP over HTTP or HTTPS.
WCF services use SOAP by default, but the messages can be in any format, and conveyed by using any transport protocol like HTTP,HTTPs, WS- HTTP, TCP, Named Pipes, MSMQ, P2P(Point to Point) etc.
3. Web services have “.asmx” extension, whereas Wcf services have “.svc” extension.
4. The asmx page uses “WebService” directive where as the svc page uses “ServiceHost” directive.
5. ASP.NET Web services rely on the XmlSerializer in System.XML.Serialization namespace for serialization (to translate data in .NET Framework types to XML and vice versa for transmission to or from a service). XmlSerializer has some limitations like:
- Only public properties/fields can be serialized.
- Only collection classes implementing IEnumerable or Icollection can be serialized.
- Classes that implement IDictionary, such as HashTable cannot be serialized.
- You can't explicitly indicate which fields or properties are to be serialized into XML and which are to be ignored by serializer.
ASP.NET WCF services use DataContractSerializer in System.RunTime.Serialization namespace for serialization, which overcomes all the limitations of XmlSerializer mentioned above.
Some more Differences between WCF and Web service
Web service is a part of WCF. WCF offers much more flexibility and portability to develop a service when comparing to web service. Still we are having more advantages over Web service; following table provides detailed difference between them.
Features
|
Web Service
|
WCF
|
Hosting
|
It can be hosted in IIS
|
It can be hosted in IIS, windows activation service, Self-hosting, Windows service
|
Programming
|
[WebService] attribute has to be added to the class
|
[ServiceContract] attribute has to be added to the class
|
Model
|
[WebMethod] attribute represents the method exposed to client
|
[OperationContract] attribute represents the method exposed to client
|
Operation
|
One-way, Request- Response are the different operations supported in web service
|
One-Way, Request-Response, Duplex are different type of operations supported in WCF
|
XML
|
System.Xml.serialization name space is used for serialization
|
System.Runtime.Serialization namespace is used for serialization
|
Encoding
|
XML 1.0, MTOM(Message Transmission Optimization Mechanism), DIME, Custom
|
XML 1.0, MTOM, Binary, Custom
|
Transports
|
Can be accessed through HTTP, TCP, Custom
|
Can be accessed through HTTP, TCP, Named pipes, MSMQ,P2P, Custom
|
Protocols
|
Security
|
Security, Reliable messaging, Transactions
|
No comments:
Post a Comment