1.Difference
between Self Hosting and IIS Hosting
-
S.No Self Hosting IIS Hosting 1Coding Effort:We need to add some extra code to host the processCoding Effort:No need to add extra code Automatic hosting2 Deployment:Easy to deployDeployment:More difficult to deploy than Self-Hosting3 Recycling:Automatic process recycling is not possibleRecycling:Automatic process recycling is possible4 Service Lifetime:Can control the service lifetime using Open and Close methodsService Lifetime:Lifetime cannot be controlled manually.5 Host Process:Host process should be running before client makes a call to the service.Host Process:IIS host runs automatically when a client makes a call to the service.
2.Difference
between Behaviour
and Contract
(OR)
Difference
between Service Behaviour
and Service Contract
-
S.No Service Contract Service Behaviour 1Behaviour:Affects the behavior of both client and serverBehaviour:Only affects the behavior of the server2 Applicability:Can apply to both interface and classApplicability:Only applicable to a class implementation3 Impact on WSDL:Affects the WSDL emittedImpact on WSDL:Does not affect the WSDL
3.Difference
between proxy and channel factory
-
S.No Proxy Channel Factory 1Only requires URL where the service residesWe must have direct access to the assembly that contains that service contractT
for2 Very simplerNot easier3 Easy to understandChannels are complex, network-related4 There is Visual Studio gives us add the referenceWhen we share a common service contract dll between the client and the server, we will be using the ChannelFactory class5 Proxies have several restrictions like:- Properties need to have gets and sets
- Contructors cannot be exposed
- Methods other than the service contract cannot be exposed
If we know that our entities will not change much and the client code is less, then a DLL would work better than a proxy6 By using SVCutil.exe we will create ProxyWhen we are using DLL that refers Service contract interface then use the channel factory class
4.Difference
between DataContractSerializer and XMLSerializer
-
S.No DataContractSerializerXMLSerializer1A practical benefit of the design of the DataContractSerializer is better performance over Xmlserializer. This is because DataContratSerializer explicitly shows the which fields or properties are serialized into XML.XMLSerializer does not provide better performance when compare with DataContratSerializer because XMLSerializer does not indicate which fields or properties of the type are serialized into XML2 The DataContractSerializer can translate the HashTable into XML.XMLSerializer cannot translate the HashTable into XML.3 DataContractSerializer is basically for very small, simple subset of the XML infoset.XMLSerializer is used for complex schemas.4 DataContractSerializer serializes private members.XmlSerializer cannot serialize private members5 DataContractSerializer uses the opts-in approach i.e, selecting the members that needs to be serialized .This is called as opts-in approach.XmlSerializer uses opts-out approach i.e., marking the members do not need to be serialized. This is called as opts-out approach.6 DataContractSerializer can serialize both private and public types.XmlSerializer can serialize only public types. If we are trying to serialize a class that is marked private by InvalidOperation Exception will be thrown by the serializer.7 DataContractSerializer does not need any default constructor before serializing any type.For any types that needs to be serialized by XmlSerializer must have a default constructor.8 DataContractSerializer does not give more control over the generated xml structure compared to the XmlSerializer.XmlSerializer gives more control over the generated xml structure compared to the DataContractSerializer.For ex, if a field should come as an attribute or element.9 DataContractSerializer can able to serialize types that implements Idictionary.XmlSerializer cannot able to serialize types that implements IDictionary, for ex. Dictionary type cannot be serialized.10 We can serialize a type that marked with [Serializable] attribute with DataContractSerializer. It serializes all the members (private, public) even they are marked with [XmlIgnore].Only the public members are serialized not the private members. Suppose we do not need any of the member to be serialized we can use [XmlIgnore] attribute11 WCF uses DataContractSerializer attributeWebservice uses XMLSerializer attribute
please post the difference between wcf and web service
ReplyDeleteHi Vinod,
DeleteKindly look at the following URL to know the differences between WCF & Web Service,
http://onlydifferencefaqs.blogspot.in/2012/07/wcf-difference-faqs-1.html
and also post difference between wpf and wcf
ReplyDeleteHi Vinod,
DeletePlease look at the below URL for WPF vs WCF,
http://www.c-sharpcorner.com/Interviews/answer/2751/what-is-the-difference-between-wpf-and-wcf