Component-based Programming with .NET Final Exam

Card Set Information

Component-based Programming with .NET Final Exam
2014-04-10 18:32:57

Final Exam Components
Show Answers:

  1. Service endpoint
    • everything that must be exposed by a WCF service 
    • explains how the service may be accessed by the client
  2. 3 elements needed to define an endpoint
    • address
    • binding
    • contract
  3. Endpoint element - address
    a full network address where the service is being hosted
  4. Endpoint element - binding
    a description of the communication protocol the client is expected to use to communicate with the service
  5. Endpoint element - contract
    • a description of the semantics required to exchange messages with the service
    • and interface with method prototypes
  6. object that implements a service contract vs. one that defines a data contract
    • implementing a service contract is hosted by the service and never by the client.
    • defining data contracts are serialized by the service and deserialized by the client so the client has a local copy of the object.
  7. How can an interface definition be transformed into a WCF service contract?
    An interface can be decorated with the [ServiceContract] attribute and its methods decorated with the [OperationContract] attribute.
  8. How can a data class definition be transformed into a WCF data contract?
    a data class can be decorated with the [DataContract] attribute and its member variables decorated with the [DataMember] attribute.
  9. BasicHttpBinding
    • suitable for cross-platform communication 
    • .NET client consumes a Web Service
    • uses XML-based messaging (not efficient)
  10. NetTcpBinding
    • only suitable for communication between .NET clients and services.
    • binary format (efficient)
  11. NetNamedPipeBinding
    built-in binding only works for pure .NET solutions running on a single computer
  12. 3 instance context modes in WCF
    • Single
    • PerCall
    • PerSession
  13. PerCall
    new object is activated to service each method call
  14. PerSession
    new object is activated to service each client session
  15. How can the programmer assign a particular instance context mode for a service object?
    • decorating a class with with variations of the [ServiceBehaviour] attribute.
    • e.g. [ServiceBehaviour(InstanceContextMode = InstanceContextMode.PerCall)]
  16. 2 ways a WCF client project in VS can obtain metadata about a WCF service contracts
    • 1. adding a reference to a custom library containing the required service and data contracts.
    • 2. adding a service reference to the specific service as long as the service is running at the time and the service supports MEX
  17. MEX
    metadata exchange
  18. Latter technique
    a proxy class will be generated in the client project which hides any WCF-specific code.
  19. callback contract
    a service contract that is implemented by a client of a WCF service and used by the service to update the client whenever a significant event has occurred in the service object.