// The key WCF namespace.
using System.ServiceModel;
namespace MagicEightBallServiceLib
{
public class MagicEightBallService
{
}
}
Our class type will implement a single WCF service contract represented by a strongly typed
CLR interface named IEightBall. As you most likely know, the Magic 8-Ball is a toy that allows you
to view one of a handful of fixed answers to a question you may ask. Our interface will define a sin-
gle method that allows the caller to pose a question to the Magic 8-Ball to obtain a random answer.
WCF service interfaces are adorned with the [ServiceContract] attribute, while each interface
member is decorated with the [OperationContract] attribute (more details regarding these two
attributes in just a moment). Here is the definition of the IEightBall interface:
[ServiceContract]
public interface IEightBall
{
Do'stlaringiz bilan baham: |