Which code should you use?

DRAG DROP
Contract exhibit:
[ServiceContract]
public interface IHelloService
[OperationContract]
[WebGet(UriTemplate =“helloname={name}”)]
string PassGuideHello(string name);
}
Class exhibit:
public class HelloService: IHelloService
{
public string PassGuideHello(string name)
{ return “Hi there “ + name;

}
}
Hosting code exhibit:
WebServiceHost svcHost = CreateHost();
svcHost.Open();
Console.ReadLine();
SrvHost.Close();
There is a WCF (Windows Communication Foundation) service PassGuideService.
The contract of PassGuideService, the implementation, and self-hosted service hosting code are
displayed in separate exhibits.
A single endpoint, at http://PassGuide:7500/HelloService, is used for the implementation of CreateHost.
Which code should you use?

DRAG DROP
Contract exhibit:
[ServiceContract]
public interface IHelloService
[OperationContract]
[WebGet(UriTemplate =“helloname={name}”)]
string PassGuideHello(string name);
}
Class exhibit:
public class HelloService: IHelloService
{
public string PassGuideHello(string name)
{ return “Hi there “ + name;

}
}
Hosting code exhibit:
WebServiceHost svcHost = CreateHost();
svcHost.Open();
Console.ReadLine();
SrvHost.Close();
There is a WCF (Windows Communication Foundation) service PassGuideService.
The contract of PassGuideService, the implementation, and self-hosted service hosting code are
displayed in separate exhibits.
A single endpoint, at http://PassGuide:7500/HelloService, is used for the implementation of CreateHost.
Which code should you use?

Answer:

Explanation:



Leave a Reply 0

Your email address will not be published. Required fields are marked *