You need to tweak the code in order to make it work

Contract exhibit:
[ServiceContract(CallbackContract typeof(INameService))]
public interface IGreetingSennce
{
[OperationContract]
string GetMessage0,
}

[ServiceContract]
public interface INameService
{
[OperationContract]
string GetName();
}
IGreetingService interface exhibit:
public class GreetingService IGreetingService
{
public string GetMessage()
{
INameService clientChannel OperationContext Current.GetCallbac kChannel
<INameService>;
using clientName = clientChanne[GetName()];
return String.Format(“Hi there {0}, clientName);
}}
Hosting code exhibit:
ServiceHost host = new ServiceHost(typeof(GreetingService));
NetTcpBinding binding = new NetTcpBinding(SecurityMode.None);
host Add ServiceEndpoint(PassGuideAppIGreetingService”,
binding, net.tcp:localhost = “96374″);
host Open();
INameService interface exhibit:
class NameService INameService
{

string name;
public NameService(string name)
{
this.name = name;
}
public string GetName()
{
return name;
}}
There is a WCF (Windows Communication Foundation) service PassGuideService.
PassGuideService is self-hosted.
The implementations of contracts, the IGreetingService interface, the hosting code, and the
INameService interface are all being displayed in the exhibits.
At the moment the above code fails at line “return String.Format(“Hi there {0}, clientName);”.
You need to tweak the code in order to make it work.
What should you do? (select three)
Use code…

Contract exhibit:
[ServiceContract(CallbackContract typeof(INameService))]
public interface IGreetingSennce
{
[OperationContract]
string GetMessage0,
}

[ServiceContract]
public interface INameService
{
[OperationContract]
string GetName();
}
IGreetingService interface exhibit:
public class GreetingService IGreetingService
{
public string GetMessage()
{
INameService clientChannel OperationContext Current.GetCallbac kChannel
<INameService>;
using clientName = clientChanne[GetName()];
return String.Format(“Hi there {0}, clientName);
}}
Hosting code exhibit:
ServiceHost host = new ServiceHost(typeof(GreetingService));
NetTcpBinding binding = new NetTcpBinding(SecurityMode.None);
host Add ServiceEndpoint(PassGuideAppIGreetingService”,
binding, net.tcp:localhost = “96374″);
host Open();
INameService interface exhibit:
class NameService INameService
{

string name;
public NameService(string name)
{
this.name = name;
}
public string GetName()
{
return name;
}}
There is a WCF (Windows Communication Foundation) service PassGuideService.
PassGuideService is self-hosted.
The implementations of contracts, the IGreetingService interface, the hosting code, and the
INameService interface are all being displayed in the exhibits.
At the moment the above code fails at line “return String.Format(“Hi there {0}, clientName);”.
You need to tweak the code in order to make it work.
What should you do? (select three)
Use code…

A.
[ServiceContract(CallbackContract = typeof(INameService), SessionMode = SessionMode.
Required)]

B.
[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Unique)]

C.
[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Reentrant)]

D.
..and Insert the following code before the first line in the implementation of..

E.
..and replace the first in the implementation of..

F.
..the contracts.

G.
.. the IGreetingService interface

H.
.. the hosting code

I.
.. INameService interface

Explanation:



Leave a Reply 0

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