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)

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:
Dim host As ServiceHost = New ServiceHost(GetType(CounterService))
Dim bidl As NetTcpBinding =
New NetTcpBinding(SecurityMode.None)
host.AddServiceEndpoint(”PassGuideApp.ICounterService”,
binding, “net.tcp://localhost: 98765”)
host.Open()
Bind2 exhibit:
host.AddServiceEndpoint(‘’PassGuideApp.ICounterService”,
bind2, “http:/!localhost: 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 Function PutMessage(ByVal message As String)
MessageDatabase.PutMessage(message)
<OperationContract>
Public Function SearchMessages(ByVal search As String) as String
Return MessageDatabase.SearchMessages(search)
End Function
End Class
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>
PuElic Interface ITeamMessageService
<OperationContract>

Function GetMessage() As String
<OperationContract>
Sub PutMessage(Byval message As String)
End Interface
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?

Which of the following actions should you perform to accomplish the task?

You work as a Windows Developer for PassGuide.com. You are tasked to create a Windows
Communication Foundation client application by using Microsoft .NET Framework 4.0. You are
required to examine the parameters on the client application. Which of the following actions should
you perform to accomplish the task?
Each correct answer represents a part of the solution. Choose three.

Which of the following code statements should you insert at line number 04 to accomplish the task?

John works as Windows Application Developer for PassGuide.com. The company uses Visual
Studio .NET Framework 4.0 as its application development platform. John has been given a task
to create a WCF Service based on Framework 4.0. John is required to add the following code
segment: (Line numbers are included for reference only.)
01 [ServiceContract(SessionMode=SessionMode.Required)]
02 public interface IInventoryManager
03 {
04
05 void CloseOrder();
06 }
John needs to decorate and manage the operation as the method that closes the current session
method. Which of the following code statements should you insert at line number 04 to accomplish
the task?

Which of the following codes should you insert at line number 06?

You are working on a WCF service that will be accessed by several clients. The service will be
used by a bank to handle financial calculations. You want to ensure that the service uses
sessions. You have written the following code segment: (Line numbers are included for reference
only.)
01 namespace MyBankService
02 {
03 [ServiceContract(Name = “BankService”,
04 Namespace = “http://www.mybankservice.com”,
05 CallbackContract = typeof(IBankService),
06 ‘ Insert code statement here.)]
07 public interface IBankService
08 {
09 [OperationContract(IsOneWay = true)]
10 int Deposit(double amount, int accountnum);
11 }
12 }
Which of the following codes should you insert at line number 06?

What should be done in the code to correct this error so that the service will compile and run properly?

You have been tasked with creating a WCF service for a hospital. This service will provide access
to patient data. You have written the following code:
using System;
using System.ServiceModel;
namespace MyHospital.PatientService
{
[ServiceContract(Namespace=”MyHospital.PatientService”)]
public interface IPatientService
{
[OperationContract]
void CheckOutPatient(int PatientID);
int FindPatientRecord(string LastName,stringFirstName);
int AddPatientRecord(string LastName,stringFirstName);
}
}
However, you are getting an error in the above code. What should be done in the code to correct
this error so that the service will compile and run properly?

you need to specify in your binding, in order to implement transactions in your WCF service 4.0? Each correct

You work as a Windows Developer for PassGuide.com. The company uses Visual Studio .NET

Framework 4.0 as its application development platform. You have been tasked to implement
transactions in your WCF service 4.0. Which of the following attributes would you need to specify
in your binding, in order to implement transactions in your WCF service 4.0?
Each correct answer represents a complete solution. Choose all that apply.

Which of the following code segments should you insert at line number 07?

You work as an Application Developer for PassGuide.com. You are tasked with creating a WCF
application for a bank. You write the following code segment: (Line numbers are for reference
only.)
01 [ServiceContract]
02 public interface IBankService
03 {
04 [OperationContract]
05 void WithdrawFunds();
06{
07
08 public class ServiceImpl : IBankService
09 {
10 [OperationBehavior(TransactionScopeRequired=true)]
11 public void WithdrawFunds() { }
12 }
You need to ensure that each service call is allowed on the service instance at a time and the
service object is released as soon as the current transaction is completed. Which of the following
code segments should you insert at line number 07?


Page 13 of 15« First...1112131415