Difference between basicHttpBinding and wsHttpBinding

Criteria      BasicHttpBinding                      WsHttpBinding
Security      This supports the old ASMX            This exposes web services using WS-*
support       style, i.e. WS-BasicProfile 1.1.      specifications.
Compatibility This is aimed for clients who do      As its built using WS-* specifications,
              not have .NET 3.0 installed and it    it
              supports wider ranges of clients.     does not support wider ranges of client
              Many of the clients like Windows      and it cannot be consumed by older
              2000 still do not run .NET 3.0. So    .NET version less than 3 version.
              older version of .NET can
              consume this service.
Soap version SOAP 1.1                               SOAP 1.2 and WS-Addressing
                                                    specification.
Reliable      Not supported. In other words, if     Supported as it supports WS-*
messaging     a client fires two or three calls     specifications.
              you really do not know if they
              will return back in the same
              order.
Default       By default, there is no security      As WsHttBinding supports WS-*, it
security      provided for messages when the        has
options       client calls happen. In other         WS-Security enabled by default. So the
              words, data is sent as plain text.    data is not sent in plain text.
Security      None                                  None
options       Windows – default authentication      Transport
              Basic                                 Message
              Certificate                           Transport with message credentials

Difference between Message and Transport level security in WCF

 Criteria                   Transport Security                 Message Security
 Scenarios when we          When there are no intermediate       When there are intermediate
 should be using one of     systems in between this is the       systems like one more WCF
 them                       best methodology.                    service through which message is
                                                                 routed then message security is
                            If it’s an intranet type of solution the way to go.
                            this is most recommended
                            methodology.
 Advantages                 Does not need any extra coding     Provides end to end security as
                            as protocol inherent security is   it’s not dependent on protocol.
                            used.                              Any intermediate hop in network
                                                               does not affect the application.
                            Performance is better as we can
                            use hardware accelerators to       Supports wide set of security
                            enhance performance.               options as it is not dependent on
                                                               protocol. We can also implement
                            There is lot of interoperability   custom security.
                            support and communicating
clients do not need to understand
                             WS security as it’s built in the
                             protocol itself.
 Disadvantages               As it’s a protocol implemented     Needs application refactoring to
                             security so it works only point to implement security.
                             point.
                                                                As every message is encrypted
                             As security is dependent on        and signed there are performance
                             protocol it has limited security   issues.
                             support and is bounded to the
                             protocol security limitations.     Does not support interoperability
                                                                with old ASMX webservices

Difference between Buffered transfer and Streamed transfer in WCF

  S.No       Buffered Transfer                     Streamed Transfer
  1          Target can process the message once   Target can start processing the data when it
             it is completely received.            is partially received.
  2          Performance will be good when         Performance will be good when message
             message size is small                 size is larger(more than 64K)
  3          Native channel shape is               Native channels are IRequestChannel and
             IDuplexSessionChannel                 IReplyChannel

Difference between WCF and Web Services

      S.No    Features          WebService                       WCF
      1       Hosting           It can be hosted in IIS          t can be hosted in IIS,
                                                                 windows activation
                                                                 service, Self-hosting,
                                                                 Windows service
      2       Programming       [WebService] attribute has       [ServiceContract]
                                to be added to the class         attribute has to be
                                                                 added to the class
      3       Model             [WebMethod] attribute            [OperationContract]
                                represents the method            attribute represents the
                                exposed to client                method exposed to
                                                                 client
      4       Operation         One-way, Request-                One-Way, Request-
                                Response are the different       Response, Duplex are
                                operations supported in          different type of
                                web service                      operations supported in
                                                                 WCF
      5       XML               System.Xml.serialization         System.Runtime.Seriali
                                name space is used for           zation namespace is
                                serialization                    used for serialization
      6       Encoding          XML 1.0,                         XML 1.0, MTOM,
                                MTOM(Message                     Binary, Custom
                                Transmission
                                Optimization Mechanism),
                                DIME, Custom
7   Transports   Can be accessed through      Can be accessed
                 HTTP, TCP, Custom            through HTTP, TCP,
                                              Named pipes,
                                              MSMQ,P2P, Custom
8   Protocols    Security                     Security, Reliable
                                              messaging,
                                              Transactions
9   State        Web Services are stateless   WCF Services can
    Management                                manage states

Wcf difference faqs-1

  • 1.
    Difference between basicHttpBindingand wsHttpBinding Criteria BasicHttpBinding WsHttpBinding Security This supports the old ASMX This exposes web services using WS-* support style, i.e. WS-BasicProfile 1.1. specifications. Compatibility This is aimed for clients who do As its built using WS-* specifications, not have .NET 3.0 installed and it it supports wider ranges of clients. does not support wider ranges of client Many of the clients like Windows and it cannot be consumed by older 2000 still do not run .NET 3.0. So .NET version less than 3 version. older version of .NET can consume this service. Soap version SOAP 1.1 SOAP 1.2 and WS-Addressing specification. Reliable Not supported. In other words, if Supported as it supports WS-* messaging a client fires two or three calls specifications. you really do not know if they will return back in the same order. Default By default, there is no security As WsHttBinding supports WS-*, it security provided for messages when the has options client calls happen. In other WS-Security enabled by default. So the words, data is sent as plain text. data is not sent in plain text. Security None None options Windows – default authentication Transport Basic Message Certificate Transport with message credentials Difference between Message and Transport level security in WCF Criteria Transport Security Message Security Scenarios when we When there are no intermediate When there are intermediate should be using one of systems in between this is the systems like one more WCF them best methodology. service through which message is routed then message security is If it’s an intranet type of solution the way to go. this is most recommended methodology. Advantages Does not need any extra coding Provides end to end security as as protocol inherent security is it’s not dependent on protocol. used. Any intermediate hop in network does not affect the application. Performance is better as we can use hardware accelerators to Supports wide set of security enhance performance. options as it is not dependent on protocol. We can also implement There is lot of interoperability custom security. support and communicating
  • 2.
    clients do notneed to understand WS security as it’s built in the protocol itself. Disadvantages As it’s a protocol implemented Needs application refactoring to security so it works only point to implement security. point. As every message is encrypted As security is dependent on and signed there are performance protocol it has limited security issues. support and is bounded to the protocol security limitations. Does not support interoperability with old ASMX webservices Difference between Buffered transfer and Streamed transfer in WCF S.No Buffered Transfer Streamed Transfer 1 Target can process the message once Target can start processing the data when it it is completely received. is partially received. 2 Performance will be good when Performance will be good when message message size is small size is larger(more than 64K) 3 Native channel shape is Native channels are IRequestChannel and IDuplexSessionChannel IReplyChannel Difference between WCF and Web Services S.No Features WebService WCF 1 Hosting It can be hosted in IIS t can be hosted in IIS, windows activation service, Self-hosting, Windows service 2 Programming [WebService] attribute has [ServiceContract] to be added to the class attribute has to be added to the class 3 Model [WebMethod] attribute [OperationContract] represents the method attribute represents the exposed to client method exposed to client 4 Operation One-way, Request- One-Way, Request- Response are the different Response, Duplex are operations supported in different type of web service operations supported in WCF 5 XML System.Xml.serialization System.Runtime.Seriali name space is used for zation namespace is serialization used for serialization 6 Encoding XML 1.0, XML 1.0, MTOM, MTOM(Message Binary, Custom Transmission Optimization Mechanism), DIME, Custom
  • 3.
    7 Transports Can be accessed through Can be accessed HTTP, TCP, Custom through HTTP, TCP, Named pipes, MSMQ,P2P, Custom 8 Protocols Security Security, Reliable messaging, Transactions 9 State Web Services are stateless WCF Services can Management manage states