PrepAway - Latest Free Exam Questions & Answers

Category: 70-513 (v.1)

Exam 70-513: TS: Windows Communication Foundation Development with Microsoft .NET Framework 4 (update June 30th, 2014)

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…

Which interface should be used for PassGuideContract class?

DRAG DROP

There is WCF (Windows Communication Foundation) service PassGuideService.
A data contract PassGuideContract for PassGuideService is being implemented.
PassGuideContract must be forward-compatible.
The round trips must include the information in PassGuideContract.
It should be able to add ew data members to PassGuideContract.
You do have to follow a strict schema validitiy.
Which interface should be used for PassGuideContract class?

How should this be achieved?

Contract exhibit:
[ServiceContract(Namespaces”http://PassGuide.com”)]
public interface IShipping {
[OperationContract] string PassGuideWork(int id);
}
There is a WCF (Windows Communication Foundation) application PassGuideApp.
There is a WCF (Windows Communication Foundation) service PassGuideService.
The contract of PassGuideService is being displayed in the exhibit.
PassGuideApp is also hosting other services.
PassGuideApp endpoints use SOAP 1.2 bindings with WS-Addressing 1.0.
There is one single lister configured in System.ServiceModel.MessageLogging trace source of the
system.diagnostics configuration section.
Only the messeages that the PassGuideWork operation returns should be logged.
How should this be achieved? Select four.

How can you ensure that PassGuideOp1 and PassGuideOp2 runs within the same transaction whenever they are calle

DRAG DROP
Service implementation exhibit:
class PassGuideService: IPassGuideService
{
public void PassGuideOp1(string value) {}
public void PassGuideOp2(string value) { }
}
Contract exhibit:
[ServiceContract(SessionMode s SessionMode Required)]
public interface IPassGuideService
{
[OperationContract(IsOneWay = true, IsInitiating = true)]
void PassGuideOp1(string value);
[OperationContract(IsOneWay = true, IsInitiating = false)]

void PassGuideOp2(string value);
}
There is a WCF (Windows Communication Foundation) service PassGuideService.
The contract and implementation of PassGuideService is being displayed in the exhibits.
NetMsmqBinding us used by PassGuideService to listen for messages.
The queue is configured to use transactions for removing and adding messages.
How can you ensure that PassGuideOp1 and PassGuideOp2 runs within the same transaction
whenever they are called within the same session?

How can this be remedied?

DRAG DROP
ContractExhibit:
Interface
[ServiceContract]
public interface IPassGuideService
{
[OperationContract]
void SaveEmployee(Employee person);
}
Binding exhibit:
NetTcpBinding binding new NetTcpBinding { TransactionFlow = true };
Client Call exhibit:
using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
{ IPassGuideService client = factoryCreateChannel();

client SaveEmployee(employee);
ConsoleWriteLine(
TransactionCurrentTransactionlnformation.
DistributedIdentifier);
tsComplete();
}
SaveEmployee Exhibit:
public void IPassGuideService SaveEmployee(Employee employee)
{ employee.Save();
ConsoleWriteLine(TransactionCurrentTransactionlnformation.
Distributedidentifier);
}
There is a WCF (Windows Communication Foundation) service PassGuideService.
The service and the client has the service contract displayed in the contract exhibit.
The binding of the service and the client is displayed in the binding exhibit.
The client call exhibit displays how the client calls PassGuideService.
The implementation of the PassGuideService SaveEmployee method is displayed in the
SaveEmployee Exhibit.
However, there is a problem. There is distributed identifier mismatch between the client and
PassGuideService.
How can this be remedied?

Which contract should be used?

DRAG DROP
There is a WCF (Windows Communication Foundation) solution for PassGuide.
You need to specify the contract complying to the following requirements:
PassGuideInitialize can always be called before PassGuideTerminate is called.
PassGuideSomething can only be called after PassGuideInitialize has been called.
PassGuideSomething cannot be called after PassGuideTerminate has been called.
PassGuideTerminate can only be called after PassGuideInitialize has been called.
Which contract should be used?

How should bind2 be defined and configured?

DRAG DROP
Hosting Code Exhibit:
ServiceHost host = new ServiceHost(typeof(CounterService));
NetTcpBinding bind1 =
new NetTcpBinding(SecurityMode None);
host.AddServiceEndpoint(”PassGuideApp.ICounterService”,
bind1, “net.tcp://localhost: 98765”);
host.Open0;
Bind2 exhibit:
host.AddServiceEndpoint(”PassGuideApp.ICounterService”,
bind2, “http:Illocalhost: 98765”);

There is a WCF (Windows Communication Foundation) self-hosted service PassGuideService.
PassGuideService provides a session-based counter.
PassGuideService is exposed over TCP.
The PassGuideService hosting code is being displayed in the exhibit.
PassGuideService must also be exposed over HTTP for external clients.
The session-counter must be able to perform over HTTP at it does over TCP.
How should bind2 be defined and configured?

you need to tweak the performance of PassGuideService so it allows the maximum number calls the methods

DRAG DROP
Exhibit:
[ServiceContract]
[ServiceBehavior(ConcurrencyMode =
ConcurrencyMode.Multiple)]
public class DataAccessService
{
[OperationContract]
public void PutMessage(string message)
{
MessageDatabase.PutMessage(message);
}
[OperationContract]
public string SeachMessages(string search)
{
return MessageDatabase.SearchMessages(search);
}
}
There is a WCF (Windows Communication Foundation) service PassGuideService.
PassGuideService is specified in the exhibit.
PassGuideService is used over a TCP binding.
At the moment MessageDatabase only support a small finite number of concurrent executions of
the methods belonging to it.
While not preventing users to connecting to PassGuideService you need to tweak the
performance of PassGuideService so it allows the maximum number calls the methods.
What should be done?

Which code should be used?

DRAG DROP
Exhibit:
[ServiceContract]
public interface ITeamMessageService
{

[OperationContract]
string GetMessage0;
[OperationContract]
void PutMessage(string message);
}
There is a WCF (Windows Communication Foundation) service PassGuideService.
PassGuideService uses the contract being displayed in the exhibit.
PassGuideService is used to share messages between the clients.
You need to ensure that all the clients receive the same message from the GetMessage method,
even if the PutMessage method is used by another client.
Which code should be used?


Page 6 of 15« First...45678...Last »