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 *