Which code segment should you use?

You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.
You need to programmatically add the following endpoint definition to the service. http://localhost:8000/ExamService/service
Which code segment should you use?

You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.
You need to programmatically add the following endpoint definition to the service. http://localhost:8000/ExamService/service
Which code segment should you use?

A.
String baseAddress=”http: //localhost:8000/ExamService”;
BasicHttpBinding binding1=new BasicHttpBinding();
using(ServiceHost host=new ServiceHost(typeof(ExamService)))
{
host.AddServiceEndpoint(typeof(IExam),binding1,baseAddress);
}

B.
String baseAddress=”http: //localhost:8000/ExamService/service”;
BasicHttpBinding binding1=new BasicHttpBinding();
using(ServiceHost host=new ServiceHost(typeof(ExamService)))
{
host.AddServiceEndpoint(typeof(IExam),binding1,baseAddress);
}

C.
String baseAddress=”http: //localhost:8000/ExamService”;
WsHttpBinding binding1=new WsHttpBinding();
using(ServiceHost host=new ServiceHost(typeof(ExamService)))
{
host.AddServiceEndpoint(typeof(IExam),binding1,baseAddress);
}

D.
String baseAddress=”net.tcp: //localhost:8000/ExamService/service”;
NetTcpBinding binding1=new NetTcpBinding();
using(ServiceHost host=new ServiceHost(typeof(ExamService)))
{
host.AddServiceEndpoint(typeof(IExam),binding1,baseAddress);
}



Leave a Reply 0

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