News:

SQL Table To C# Entity Model ConverterEntity Model (Class Properties) to SQL Table ConverterIf you encounter any trouble visiting our site, please contact us.

Advertisement

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;
ServiceHost host = new ServiceHost(typeof(CounterService));
NetTcpBinding binding1 = new NetTcpBinding(SecurityMode.None);
host.AddServiceEndpoint("MyApplication.ICounterService", binding1, "net.tcp://localhost:23456");
host.Open();

This service is currently exposed over TCP, but needs to be exposed to external clients over HTTP. Therefore,
a new service endpoint is created with the following code.

host.AddServiceEndpoint("MyApplication.ICounterService", binding2, "http://localhost:12345");

You need to complete the implementation and ensure that the session-based counter will perform over HTTP as it does over TCP. What should you do?

  1. Define binding2 as follows

    WS2007HttpBinding binding2 = new WS2007HttpBinding(SecurityMode.None);

    Configure binding2 as follows

    binding2.ReliableSession.Enabled = true;
  2. Define binding2 as follows

    WSHttpBinding binding2 = new WSHttpBinding(SecurityMode.None);

    Add the following behavior to the service implementation

    ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]
  3. Define binding2 as follows.

    BasicHttpBinding binding2 = new BasicHttpBinding(BasicHttpSecurityMode.None);

    Enable cookies for binding2.

    binding2.AllowCookies = true:
  4. Define binding2 as follows

    BasicHttpBinding binding2 = new BasicHttpBinding(Basic HttpSecurityMode.None)

    Add the following behavior to the service implementation.

    [ServiceBehavior(InstanceContexMode = InstanceContextMode.Single)]
Answer: Answer is a
comments powered by Disqus
Advertisement

BCS Preparation now even more easy. ReadBD is the place where you can find all kind of resources to be successful in BCS,Bank,Islami Bank exam and interview.

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;