70-513 WCF Development with Microsoft .NET Framework 4 Exam Set 2

There is a WCF (Windows Communication Foundation) service PassGuideService.

There are out of-process process resources that PassGuideService must access on behalf of an

originating caller. What should you do?


Options are :

  • TokenImpersonationLevelDelegation
  • All of the above (Correct)
  • Use ServiceSecurityContext.CurrentWindowsidentity.ImpersonationLevel
  • ..and set the value to…

Answer : All of the above

70-513 WCF Development with Microsoft .NET Framework 4 Exam Set 4

John works as a Windows Application Developer for PassGuide.com. The company uses Microsoft Visual Studio .NET 2010 as its application development platform for creating

applications. He has been given a task of creating a WCF service based on Framework 4.0. He

has finished creating the WCF service and must now configure the bindings. He requires using

WSHttpBinding binding. He has already defined and implemented the service contract on the

application. What is the next step that he must take to accomplish the task?


Options are :

  • Construct a Web.config file to configure an endpoint for the Service that uses and manages WSHttpBinding. (Correct)
  • Construct a Web.config file to configure an endpoint for the Service that uses and manages WebHttpBinding.
  • Construct a Service.svc file that uses and manages WebHttpBinding
  • Construct a Service.svc file that uses and manages WSHttpBinding.

Answer : Construct a Web.config file to configure an endpoint for the Service that uses and manages WSHttpBinding.

There is a WCF (Windows Communication Foundation) service PassGuideService.

PassGuideService generates separate namespace declarations for every body member the

message contract.

How can the XML representation of the message contract be simplified under the assumption that

all body members have the same namespace?


Options are :

  • PGClass1 should be the only body member for the message contract.
  • All body members should be declared as members of PGClass1.
  • Add a new DataContract Class PGClass1.
  • ALL of the above (Correct)

Answer : ALL of the above

You work as an Application Developer for abc.com. You have been assigned to create a

WCF service for the Business School of Management. You write the following code segment to

define the service:

Public Interface ISchoolService

<OperationContract()>

Sub FindStudent(int StudentID)

End Interface

Public Class School

Implements ISchoolService

<OperationBehavior(TransactionAutoComplete:=False, TransactionScopeRequired:=True)

>

Public Sub FindStudent(int studentnumber)

End Sub

End Class

Your next task is to set the <ServiceContract> attribute for the transaction behavior of this service.

Which of the following code statements should you insert at the beginning of the above mentioned

code segment?


Options are :

  • (Correct)

Answer :

70-513 WCF Development with Microsoft .NET Framework 4 Exam Set 5

Contract exhibit:

<ServiceContract(Namespaces"http://PassGuide.com”)>

Public Interface IShipping

<OperationContract>

Function PassGuideWork(ByVal id As Integer) As String

End Interface

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?


Options are :

  • Use system.serviceModel/diagnostics/messageLogging/filters
  • //addr:Action[text() = 'http://PassGuide.com/IShipping/PassGuideWorkResponse’]
  • All of the above (Correct)
  • ..and add XML code..

Answer : All of the above

You work as a Windows Developer for PassGuide.com. You need to define a new Service

contract. Which of the following corresponds to the .NET attributes from the System.ServiceModel

namespace that you require when defining your Service contract?


Options are :

  • The MessageParameterAttribute and the OperationContractAttribute
  • The ServiceContractAttribute and the FaultContractAttribute
  • The ServiceContractAttribute and the OperationContractAttribute (Correct)
  • The FaultContractAttribute and the OperationContractAttribute

Answer : The ServiceContractAttribute and the OperationContractAttribute

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.


Options are :

  • Implement IParameterInspector interface.
  • Implement IEndpointBehavior behavior to add parameter inspector to the Dispatcher.ClientOperation.ParameterInspectors method.
  • Insert a behavior before you call the ClientBase.Open method.
  • All of the above (Correct)

Answer : All of the above

70-513 WCF Development with Microsoft .NET Framework 4 Exam Set 5

You work as a Windows Developer for PassGuide.com. You are required to create a WCF 4.0

service that will be used by multiple clients afterwards. According to the requirements, one service

object should handle all service calls and this service object should not be recycled.

Which of the following values for the session instance will You use to accomplish the task?


Options are :

  • PerSession
  • PerCall
  • Single (Correct)
  • Reentrant

Answer : Single

There is a WCF (Windows Communication Foundation) service PassGuideService.

PassGuideService is handling transmission XML documents between systems.

PassGuideService must be able to communicate with non .NET systems that uses SOAP.

PassGuideService must not use base64 encoding or escape characters in the XML documents

that is transferred.

PassGuideService must minimize the size of transmission by attaching transmitted XML

documents as is.

How can this be ensured?


Options are :

  • Use message encoding..
  • B & C (Correct)
  • Use XML encoding
  • .. Message Transmission Optimization Mechanism (MTOM)

Answer : B & C

Exhibit:

Sub PassGuideDelete (Byval PassGuideId As String)

There is a WCF service PassGuideService.

PassGuideService implements restful manner operations.

The PassGuideDelete method is implemented as displayed in the exhibit.

When a client calls PassGuideService with the HTTP DELETE operation PassGuideService must

use this method.

How can this be achieved?


Options are :

  • .. WebInvoke(UriTemplate = "/Items/(id,Method=”DELETE"
  • Use the operation..
  • All of the above (Correct)
  • ..and add attribute…

Answer : All of the above

70-513 WCF Development with Microsoft .NET Framework 4 Exam Set 3

You are working on a WCF service that will have various client sessions connecting to it. You want

a service instance to be created each time a client uses the service. Which of the following code

segments should you use to implement this?


Options are :

  • [ServiceContract(InstanceContextMode = InstanceContextMode.PerCall)]
  • [ServiceBehaviorAttribute(InstanceContextMode = InstanceContextMode.PerSession)]
  • [ServiceBehaviorAttribute(InstanceContextMode = InstanceContextMode.PerCall)] (Correct)
  • [ServiceContract (InstanceContextMode = InstanceContextMode.PerCall)]

Answer : [ServiceBehaviorAttribute(InstanceContextMode = InstanceContextMode.PerCall)]

<script typeetext/javaScript src=”Services/PassGuideService.svc/js”/>

There is a resful WCF (Windows Communication Foundation) service PassGuideService.

PassGuideService is hosted by the ASP.NET application PassGuideApp.

PassGuideApp hosts PassGuideService at location /Services/PassGuideService.svc.

Client access PassGuideService through a JavaScript resource.

See exhibit for an explicit page markup reference to PassGuideService.

How can you obtain the debug version of JavaScipt service?


Options are :

  • Use the src attribute…
  • ..in the script tag..
  • ..and append debug to it.
  • All of the above (Correct)

Answer : All of the above

You are employed as a developer at PassGuide.com.

There is a WCF (Windows Communication Foundation) service PassGuideService.

PassGuideService is based on WSHttpBinding.

Now you need to make sure that each caller must be authenticated on every call.

You also prevent caching of request token.

How can this be enforced?


Options are :

  • False
  • Use the message security configuration..
  • All of the above (Correct)
  • and set stablishSecurityContext to..

Answer : All of the above

70-513 WCF Development with Microsoft .NET Framework 4 Exam Set 3

You work as an Application Developer for PassGuide.com. The company uses Visual Studio .NET

Framework 3.5 as its application development platform. You have decided to implement

transactions in your WCF service. You wish to implement transactions in your binding settings.

Which of the following are NOT the attributes you would set?

Each correct answer represents a complete solution


Options are :

  • transactionFlow
  • C & D (Correct)
  • transactionProtocol
  • maxConnections
  • receiveTimeout

Answer : C & D

ServiceContract Exhibit:

<ServiceContract>

Public Class PassGuideService

<OperationContract>

Public Function PassGuideConfirm(ByVal PhoneNumber As String,ByVal wage As Double,ByVal

EmployeeNumber Integer) As Boolean ‘...

End Function

There is a WCF (Windows Communication Foundation) service PassGuideService.

PassGuideService exists within SOA (Service Oriented Architecture) within an enterprise.

The serviceContact of PassGuideService is displayed in the exhibit.

Method PassGuideConfirm, when executed, must be participate transperentally in existing

transactions.Furthermore, when there is no existing transaction, a new transaction must be

created.

How should the ServiceContract be tweaked to achieve is?


Options are :

  • ..add the following attribute.
  • Use the PassGuideConfirm method..
  • All of the above (Correct)

Answer : All of the above

John works as a Windows Application Developer for PassGuide.com. The company uses Visual

Studio .NET 2010 as its application development platform. John has been given a task to create a

WCF service for his company using .NET Framework 4.0. Which of the following properties does

the service require, in order to configure endpoints?

Each correct answer represents a part of the solution. Choose all that apply.


Options are :

  • Contract
  • All of the above (Correct)
  • Binding
  • Address

Answer : All of the above

70-513 WCF Development with Microsoft .NET Framework 4 Exam Set 5

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?


Options are :

  • Use system.serviceModel/diagnostics/messageLogging/filters
  • All of the above (Correct)
  • ..and add XML code..

Answer : All of the above

You work as a Windows Developer for PassGuide.com. You need to define a new Service

contract. Which of the following corresponds to the .NET attributes from the System.ServiceModel

namespace that you require when defining your Service contract?


Options are :

  • The MessageParameterAttribute and the OperationContractAttribute
  • The ServiceContractAttribute and the OperationContractAttribute (Correct)
  • The FaultContractAttribute and the OperationContr
  • The ServiceContractAttribute and the FaultContractAttribute

Answer : The ServiceContractAttribute and the OperationContractAttribute

There is WCF (Windows Communication Foundation) application PassGuideApp.

There is a data contract PassGuideData, with several data members, that is used by

PassGuideApp.

Consider a serialized instance of PassGuideData which is deserialized. If any of data members

are not available PassGuideApp must throw a Serialization Exception.

What action should you take?


Options are :

  • ..to true.
  • For each data member…
  • All of the above (Correct)
  • Set the IsRequired property..

Answer : All of the above

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?


Options are :

  • [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Unique)]
  • [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)] (Correct)
  • ..the contracts.
  • [ServiceContract(CallbackContract = typeof(INameService), SessionMode = SessionMode. Required)]

Answer : [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)]

You are creating a Windows application by using the .NET Framework 3.5.

You plan to evaluate the design strategy of the application.

The design strategy contains the following elements:

The application uses the ClickOnce deployment.

The application runs on computers that have the Microsoft Windows 98 operating system, a 256-MB RAM,

and a 1-GB disk space.

The application transmits the collected data to a server by using a Windows Communication Foundation

(WCF) service.

The application must meet the following requirements:

It displays real-time data.

It gathers data from a serial interface.

The code written for it is small and can be easily deployed.

You discover that the design strategy does not function properly.

You need to ensure that the design strategy functions appropriately.

What should you recommend?


Options are :

  • Transmit data directly to the database server.
  • Create a Microsoft Windows Installer .MSI installation package for the application
  • Upgrade the operating system to Microsoft Windows XP. (Correct)
  • Change the application to a console application

Answer : Upgrade the operating system to Microsoft Windows XP.

There is an ASP.NET page PassGuidePage.

PassGuidePage has a DataPager and a ListView control.

These two controls is used to display huge amounts of data from an external data source

one page at a time.

How can this be achieved?


Options are :

  • ..to the ID of ListViewControl
  • Set the PagedControlID Property of..
  • ..the DataPager control
  • All of the above (Correct)

Answer : All of the above

There is an ASP.NET application named PassGuideApp.

PassGuideApp is utilizing a out-of-proc mode session state.

How can you add one attribute to the Vehicle Class, displayed in the code exhibit, to make

sure you can save an instance to session state.

What would be the preferred attribute?


Options are :

  • Serializable (Correct)
  • ObjectData
  • Bindable
  • Digitized

Answer : Serializable

You create a Windows application by using the .NET Framework 3.5.

The application is used for stock trading purposes. The application has the following features:

The application is deployed to workstations that contain four monitors.

Only one instance of the application can be run at a time.

The application has a multiple-document interface (MDI).

A third-party control is used on the Windows form to display real-time data by using graphs.

The stack of monitors on each workstation is two monitors high and two monitors wide.

When multiple stock quotes are viewed at the same time, the Windows form has to be extended to

another monitor.

The information has to be viewed across the monitors together.

You need to modify the application to meet the following requirements:

Users can compare two or more stock quotes at the same time.

The Windows form can be maximized and restored to the monitor selected by the user.

Which two actions should you perform? (


Options are :

  • Add a Tab control to the Windows form and display one stock quote for each tab.
  • Write a code segment in the Load event of the Windows form. Set the Height property to twice the height of the screen, and set the Width property to twice the width of the screen.
  • C & D (Correct)
  • Allow multiple instances of the application to be run at the same time.
  • Convert the application to a single-document interface (SDI).

Answer : C & D

You are creating a Windows application by using the .NET Framework 3.5.

The application will access an external Windows Communication Foundation (WCF) service by using the

following contract.

[ServiceContract(SessionMode=SessionMode.NotAllowed)]

public interface IOrderService

{

}

The service contract has multiple operations. The operations will be called by the Windows application

when required.

For a single invocation of the application, you plan to maintain the information of the application state

between subsequent method calls to the WCF service. The application state information cannot be

persisted once the application closes.

You need to ensure that the application can consume the WCF service.

What should you do?


Options are :

  • Save the information of the application state in a Microsoft SQL Server 2008 database.
  • Use the binding and transport elements to support sessions for the WCF service in the Windows application.
  • Save the information of the application state in the Windows application (Correct)
  • Save the information of the application state in the HttpContext.Current.Session property

Answer : Save the information of the application state in the Windows application

You maintain a Windows Forms application and an ASP.NET application.

The Windows Forms application has the following features:

The application impersonates the logged-on user.

The data is stored in a Microsoft SQL Server 2008 database.

The application grants user access to data by calling the IPrincipal.IsInRole method on the basis of user

roles.

The ASP.NET application uses forms-based authentication to authenticate users.

You need to share the login and user role information between the Windows Forms application and the

ASP.NET application.

What should you do?


Options are :

  • Add a WebBrowser control to the Windows Forms application to display the ASP.NET login page.
  • Enable SQL Server authentication between the Windows Forms application and the Microsoft SQL Server 2008 database.
  • Modify the Windows Forms application to use client application services instead of impersonation (Correct)
  • Enable integrated security between the Windows Forms application and the Microsoft SQL Server 2008 database

Answer : Modify the Windows Forms application to use client application services instead of impersonation

You are creating a Windows application by using the .NET Framework 3.5.

The application has the following features:

Users access the application from their local computers.

Each user specifies the data file to be used for the current session at the start of the application.

You plan to design a strategy to enable users to share their data files with other users.

You need to implement the strategy to meet the following requirements:

Users can open the data file only by using a password.

Users can work on the data file only by using the application.

What should you do?


Options are :

  • Create a Microsoft SQL Server 3.5 Compact database file along with a custom file extension to be used as a data file. Associate the custom file extension with the application. Encrypt the data file with a password. Allow users to share their data file with other users through an e-mail message (Correct)
  • Create an XML file to be used as a data file for each user, and then place the files in a shared folder on the corporate network. Protect the shared folder by using a password. Allow users to share the password with other users through an e-mail message
  • Create a Microsoft SQL Server 2008 database for each user on the client computer. Use the database as a data file. Set a password for the system administrator login. Allow users to share the password with other users through an e-mail message
  • Create a Microsoft Office Excel 2007 workbook to be used as a data file. Associate the .xslx extension of the workbook with the application. Protect the Office Excel 2007 workbook by using a password. Allow users to share the workbook with other users through an e-mail message

Answer : Create a Microsoft SQL Server 3.5 Compact database file along with a custom file extension to be used as a data file. Associate the custom file extension with the application. Encrypt the data file with a password. Allow users to share their data file with other users through an e-mail message

There is a ASP.NET application named abc.com

PassGuideAPP has some pages which have data-bound GridView controls.

There is code (JavaScript) that occasionally change some particular data items of these

controls.

This code must be able to find HTML elements that has been created for these controls for

every particular post.

However, if the controls are moved between the pages, you must make sure that the HTML

elements does not need to be updated.

How can this been achieved?


Options are :

  • ..of every distinct GridViewControl…
  • ..to a unique value.
  • Change the ClientIDRowSuffix attribute…
  • All of the above (Correct)

Answer : All of the above

There is a ASP.NET application named PassGuideApp.

PassGuideApp has a page PassGuidePage.aspx.

PassGuidePage.aspx has a master page PassGuideMaster.aspx.

PassGuideApp must make sure that PassGuidePage.aspx reads the property FooBar from

PassGuideMaster.aspx.

The code in the code exhibit is used for this purpose.

You notice that PassGuidePage.aspx is not able to access the property FooBar.

How can you remedy this problem?


Options are :

  • A & B (Correct)
  • ..in the PassGuidePage.aspx
  • in PassGuideApp.
  • Add the directive <%@ MasterType VirtualPath="~/PassGuideMaster.master" %> …

Answer : A & B

You create a Windows application by using the .NET Framework 3.5.

The application is used for data entry purposes. The application has the following features:

Data is read from a shared Microsoft SQL Server 2008 database instance.

Data entered and saved by the users is temporarily stored in a local SQL Server 2008 Compact edition

database instance.

When the users log off from the application, new records from the local database instance are

synchronized to the shared database.

You discover that the performance of the application is affected when multiple users log off from the

application at the same time.

You need to design a performance improvement strategy for the application by using minimum amount of

cost, time, and development effort.

What should you do?


Options are :

  • Modify the application to synchronize data into the shared database as soon as the users save their work. (Correct)
  • Upgrade the local database to Microsoft SQL Server 2008 Express edition
  • Store the data entered by the users temporarily in an XML file. Merge the new records from the local XML file to the shared database when the users log off from the application.
  • Write a Web service that synchronizes data to the shared database. Call the service when the users log off from the application.

Answer : Modify the application to synchronize data into the shared database as soon as the users save their work.

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions