Exam 70-513,516,515

Exam 70-513,516,515

BSS Internal

published on January 24, 2011166 responses 0 4.5★ / 5

A Windows Communication Foundation (WCF) client uses the following service contract.
(Line numbers are included for reference only.)
01 [ServiceContract]
02 public interface IService
03 (
04 [OperationContractj
05 string Operation1O;
06 [OperationContract]
07 string Operation2(),
08)
You need to ensure that all calls to Operation 1 and Operation2 from the client are encrypted and signed What should you do?

Set the ProtectionLevel property in line 01 to EncryptAndSign
Set the ProtectionLevel property in line 04 and line 06 to Sign
Add a SecurityCriticalAttribute ror each operation
Add a SecunitySafeCriticalAttribute for each operation

Add a SecunitySafeCriticalAttribute for each operation

Select the one correct answers
Add a MessageBodyMember attribute to the CodeName property and set the ProtectionLevel to Sign. Add a MessageBodyMember attribute to the Sec retHandshake property and set the Protection Level to EncryptAndSign
Add a DataProtectionPermission attribute to the each property and set the ProtectData property to True
Add an XmlText attribute to the CodeName property and set the DataType property to Signed. Add a PasswordPropertyText attribute to the SecretHandshake property and set its value to True.
Add an ImmutableObject attribute to the CodeName property and set its value property to True. Add a Browsable attribute to the SecretHandshake property and set its value to False.

Add an ImmutableObject attribute to the CodeName property and set its value property to True.
Add a Browsable attribute to the SecretHandshake property and set its value to False.

Select the one correct answers
Add a DataProtectionPermission attribute to the CreditCardNumber property and set the ProtectData property to True.
Convert the DataContract to a MessageContract and set the ProtectionLevel property to SignAndEncrypt
Change the data type of CreditCardNumber from String to SecureString.
Implement the CreditCardNumber property getter and setter. In the setter, run the value of the CreditCardNumber through the MD5CryptoServiceProvider class TransformBlock method.

A Windows Communication Foundation (WCF) client application is consuming an RSS syndication feed from a blog.
You have a SyndicaionFeed variable named feed. The application iterates through the items as follows.
(Line numbers are included for reference only.)
01 foreach (Syndicationltem item in feed.ltems)
02 {
03 }
You need to display the content type and body of every syndication item to the console
Which two lines of code should ou insert between lines 02 and 03?

Select the one correct answers
ConsoleWriteLine(tem. Content.Type); ConsoleWriteLine(((TextSyndicationContent)tem. Content).Text);
Console.WriteLine(tem. Content.GetType0); Console.WriteLine(((TextSyndic ationContent)tem. Content).Text);
Console.WriteLine(tem.Content.Type), Console.WriteLine(tem.Content.ToString0);)
Console.WriteLine(tem.Content.GetType0); Console.WriteLine(tem.Content.ToString0);)

A Windows Communication Foundation (WCF) application exposes a service as a SOAP end point for consumption by cross-platform dents’
During integration testing, you find that one of the clients is not generating the correct messages to the WCF application.
In order to debug the issue and fix the communication, you need to configure the senice to log messages received from the client
What should you do?

Select the one correct answers
Set an etw Tracking behavior on the service and configure a listener for the System Service Model trace source
Set an etw Tracking behavior on the service and configure a listener for the System Service Model. Message Logging trace source.
Enable message Logging in the System Service Model diagnostics element configuration and configure a listener for the System Service Model Message Logging trace source.
Enable message Logging in the System.Service Model diagnostics element configuration and configure a listener for the System. Service Model trace source.

A Windows Communication Foundation (WCF) solution exposes the following contract over an HTTP connection
<ServiceContractQ>
Public Interface IDataService <OperationContract0s?
Function GetData() As String End Interface Existing clients are making blocking calls to GetData
Calls to GetData take five seconds to complete
You need to allow new clients to issue non-blocking calls to get the data, without breaking any existing clients.
What should you do?

Select the one correct answers
Replace the service interface with the following interface and implement the new methods. <ServiceContract0> Public Interface lDoSomething <OperationContractO> Function DoLong Operation () As String <OperationContract(Async Pattemn: Twe)> Function BeginDoLongOperation() As lAsync Result <OperationContract(Async Pattern: zTrue)> Function EndDoLongOperation(ByVal result As lAsync Result) As String End Interface
Replace the service interface with the following interface and implement the new methods. <ServiceContract0> Public Interface IDoSomething <OperationContract(Async Pattern True)> Function BeginDoLongOperation() As lAsync Resutt <OperationContract(Async Pattern: True)> Function EndDoLongOperation(ByVaI result As lAsyncResult) As String End Interface
Generate a proxy class with asynchronous methods and use it for the new clients.
Add a new endpoint to the service that uses a full-duplex binding and use it for the new clients

You are creating a Windows Communication Foundation (WCF) service You have the following requirements.
“Messages must be sent over TCR
‘The service must support transactions.
“Messages must be encoded using a binary encoding
“Messages must be secured using Windows stream-based security. You need to implement a custom binding for the service
In which order should the binding stack be configured?

Select the one correct answers
tc pTransport windowsStreamSec urity transactionFlow binaryMessageEnc oding
transactionFlow binaryMessageEnc oding windowsStreamSec urity tc pTransport
windowsStreamSec urity tc pTransport binaryMessageEnc oding transactionFlow

A Windows Communication Foundation (WCF) service uses the following service contract. [ServceContract]
public interface IService
{
[OperationContract]
string Operation 1 (stnng s);
}
You need to ensure that the operation contract Operationi responds to HTTP POST requests.
Which code segment should you use?

Select the one correct answers
[OperationContract| [Weblnvoke(Method POST)] string Operationl(string s);
[OperationContract| [WebGet(UriTemplate = POST’)] string Operation 1 (string s);
[OperationContract(ReplyAction z ‘POST’)J string Operationi (string s);
[OperationContract(Action WPOST)1 string Operationl(string s);

You are creating a Windows Communication Foundation (WCF) service that implements operations in a RESTful manner. You need to add a delete operation You implement the delete method as follows.
Sub Deleteltems(Byval id As String) You need to configure WCF to call this method when the client calls the service with the HTTP DELETE operation What should you do

Select the one correct answers
Add the Weblnvoke(UriTemplatez’7ltems/(id}, Method:z”DELETE”) attribute to the operation.
Add the HttpDelete attribute to the operation.
Replace the string parameter with a RemovedActivityAction parameter
Change the Sub statement to Function and specify RemovedActivityAction as the return type.

You are creating a Windows Communication Foundation (WCF) service that implements operations in a RESTful manner
You need to add a delete operation
You implement the delete method as follows.
string oid Deleteltems(string id);
You need to configi.re WCF to ci this method when the client calls the service with the HTTP DRETE opera on
What should you do?

Select the one correct answers
Add the Weblnvoke(UriTemplate = "/Items/(idy, Method=”DELETE") attribute to the operation
Add the HttpDelete tribute to the operation
Replace the stnng parameter with a RemovedActivityAction parameter
Replace the retumn type with RemovedActivityktion

You create a page in an ASP.NET Web application. The page retrieves and displays data from a Microsoft SQL Server database. You need to create a data source that can connect to the database. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

Select the two correct answers
Use an ObjectDataSource control and set its TypeName property to System.Data.SqlClient.SqlConnection.
Use a SqlDataSource control and configure its ConnectionString in the web.config file.
Use an XmlDataSource control together with an Xml control that represents the database.
Use a LinqDataSource control with entity classes that represent the elements in the database

You are implementing an ASP.NET page that will retrieve large sets of data from a data source. You add a ListView control and a DataPager control to the page. You need to ensure that the data can be viewed one page at a time. What should you do?

Select the one correct answers
Set the DataPager control’s PageSize property to the number of rows to view at one time.
Set the DataPager control’s PagedControlID property to the ID of the ListView control
In the code–behind file, set the DataPager control’s Parent property to the ListView control
In the code–behind file, set the ListView control’s Parent property to the DataPager control

You are preparing to deploy an ASP.NET application to a production server by publishing the application in Release configuration. You need to ensure that the connection string value that is stored in the web.config file is updated to the production server’s connection string value during publishing. What should you do?

Select the one correct answers
Add the following code to the web.config file. <connectionStrings> <add name="DB" connectionString="Server=ProdServer;Database=ProdDB;Integrated Security=SSPI;" providerName="Release" /> </connectionStrings>
Add the following code to the web.config file. <connectionStrings> <add name="DB" connectionString="Server=ProdServer;Database=ProdDB;Integrated Security=SSPI;" xdt:Transform="Replace" xdt:Locator="Match(name)" /> </connectionStrings>
Add the following code to the web.release.config file. <connectionStrings> <add name="DB" connectionString="Server=ProdServer;Database=ProdDB;Integrated Security=SSPI;" providerName="Release" /> </connectionStrings>
Add the following code to the web.release.config file. <connectionStrings> <add name="DB" connectionString="Server=ProdServer;Database=ProdDB;Integrated Security=SSPI;" xdt:Transform=" Replace" xdt:Locator="Match(name)" /> </connectionStrings>

You use the ASP.NET Web Application template to create an application in a new Visual Studio solution. The project uses types that are defined in a class library project. Source code for the class library is frequently modified. You need to ensure that classes in the Web application project always reference the most recent version of the class library types. What should you do?

Select the one correct answers
Add the class library project to the solution. Modify the class library project to add a reference to the Web application project.
Add the class library project to the solution. Modify the Web application project to add a reference to the class library project.
Add a post-build step to the Web application project that copies the most recent version of the class library assembly to the bin folder of the Web application
Add a post-build step to the class library project that copies the most recent version of the class library assembly to the App_Code folder of the Web application. In the <compilation /> section of the web.config file, add an <assembly /> entry that specifies the location of the class library assembly.

You are creating an ASP.NET Web site. The site contains pages that are available to anonymous users.
The site also contains a page named Premium.aspx that provides premium content to only members of a group named Subscribers.
You need to modify the web.config file to ensure that Premium.aspx can be accessed by only members of the Subscribers group.
Which configuration should you use?

Select the one correct answers
<location path="Premium.aspx"> <system.web> <authorization> <allow users="Subscribers"/> <deny users="*"/> </authorization> </system.web> </location>
<location path="Premium.aspx"> <system.web> <authorization> <allow roles="Subscribers"/> <deny users="*"/> </authorization> </system.web> </location>
<location path="Premium.aspx"> <system.web><authorization> <allow roles="Subscribers"/> <deny users="?"/> </authorization> </system.web> </location>
<location path="Premium.aspx"> <system.web> <authorization> <deny users="*"/> <allow roles="Subscribers"/> </authorization> </system.web> </location>

You are implementing an ASP.NET page. The page includes a method named GetCustomerOrderDataSet that returns a DataSet.
The DataSet includes a DataTable named CustomerDetailsTable and a DataTable named OrderDetailsTable.
You need to display the data in OrderDetailsTable in a DetailsView control named dtlView.
Which code segment should you use?

Select the one correct answers
dtlView.DataSource = GetCustomerOrderDataSet() dtlView.DataMember = "OrderDetailsTable" dtlView.DataBind()
dtlView.DataSource = GetCustomerOrderDataSet() dtlView.DataSourceID = "OrderDetailsTable" dtlView.DataBind()
dtlView.DataSource = GetCustomerOrderDataSet() dtlView.DataKeyNames = New String() {"OrderDetailsTable"} dtlView.DataBind()
Dim dataSet As DataSet = GetCustomerOrderDataSet() dtlView.DataSource = New DataTable("dataSet", "OrderDetailsTable") dtlView.DataBind()

You deploy an ASP.NET application to an IIS server.
You need to log health-monitoring events with severity level of error to the
Windows application event log.
What should you do?

Select the one correct answers
Run the aspnet_regiis.exe command.
Set the Treat warnings as errors option to All in the project properties and recompile
Add the following rule to the <healthMonitoring/> section of the web.config file. <rules> <add name="Failures" eventName="Failure Audits" provider="EventLogProvider" /> </rules>
Add the following rule to the <healthMonitoring/> section of the web.config file. <rules> <add name="Errors" eventName="All Errors" provider="EventLogProvider" /> </rules>

You are implementing an ASP.NET Web site. The site uses a component that must be dynamically configured before it can be used within site pages.
You create a static method named SiteHelper.Configure that configures the component.
You need to add a code segment to the Global.asax file that invokes the SiteHelper.Configure method the first time, and only the first time, that any page in the site is requested.
Which code segment should you use?

Select the one correct answers
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) SiteHelper.Configure() End Sub
Sub Application_Init(ByVal sender As Object, ByVal e As EventArgs) SiteHelper.Configure()End Sub
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs) SiteHelper.Configure() End Sub
Dim lockObject As Object = New Object() Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs) SyncLock (lockObject()) SiteHelper.Configure() End SyncLock End Sub

You are implementing an ASP.NET Web site. The site uses a component that must be dynamically configured before it can be used within site pages.
You create a static method named SiteHelper.Configure that configures the component.
You need to add a code segment to the Global.asax file that invokes the SiteHelper.Configure method the first time, and only the first time, that any page in the site is requested.
Which code segment should you use?

Select the one correct answers
void Application_Start(object sender, EventArgs e) { SiteHelper.Configure(); }
void Application_Init(object sender, EventArgs e) { SiteHelper.Configure(); }n
void Application_BeginRequest(object sender, EventArgs e) { SiteHelper.Configure(); }
Object lockObject = new Object(); void Application_BeginRequest(object sender, EventArgs e) { lock(lockObject()) { SiteHelper.Configure(); } }

You are implementing an ASP.NET Web site. The root directory of the site contains a page named Error.aspx.
You need to display the Error.aspx page if an unhandled error occurs on any page within the site.
You also must ensure that the original URL in the browser is not changed.
What should you do?

Select the one correct answers
Add the following configuration to the web.config file. <system.web> <customErrors mode="On"> <error statusCode="500" redirect="~/Error.aspx" /> </customErrors> </system.web>
Add the following configuration to the web.config file. <system.web><customErrors redirectMode="ResponseRewrite" mode="On" defaultRedirect="~/Error.aspx" /> </system.web>
Add the following code segment to the Global.asax file. void Application_Error(object sender, EventArgs e) { Response.Redirect("~/Error.aspx"); }
Add the following code segment to the Global.asax file. void Page_Error(object sender, EventArgs e) Server.Transfer("~/Error.aspx"); }

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Forms application. The application connects to a Microsoft SQL Server database.
You need to find out whether the application is explicitly closing or disposing SQL connections.
Which code segment should you use?

Select the one correct answers
Dim instanceName As String = Assembly.GetEntryAssembly().FullName Dim perf As New PerformanceCounter( ".NET Data Provider for SqlServer", "NumberOfReclaimedConnections", instanceName, True)
Dim leakedConnections As Integer = DirectCast(perf.NextValue(), Integer) Dim instanceName As String = Assembly.GetEntryAssembly().GetName().Name Dim perf As New PerformanceCounter( ".NET Data Provider for SqlServer", "NumberOfReclaimedConnections", instanceName, True)
Dim leakedConnections As Integer = DirectCast(perf.NextValue(), Integer) Dim instanceName As String = Assembly.GetEntryAssembly().FullName Dim perf As New PerformanceCounter( ".NET Data Provider for SqlServer", "NumberOfNonPooledConnections", instanceName, True)
Dim leakedConnections As Integer = DirectCast(perf.NextValue(), Integer) Dim instanceName As String = Assembly.GetEntryAssembly().GetName().Name Dim perf As New PerformanceCounter( ".NET Data Provider for SqlServer", "NumberOfNonPooledConnections", instanceName, True) Dim leakedConnections As Integer = DirectCast(perf.NextValue(), Integer)

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Forms application. The application connects to a Microsoft SQL Server database.
You need to find out whether the application is explicitly closing or disposing SQL connections.
Which code segment should you use?

Select the one correct answers
string instanceName = Assembly.GetEntryAssembly().FullName; PerformanceCounter perf = new PerformanceCounter( ".NET Data Provider for SqlServer", "NumberOfReclaimedConnections", instanceName, true); int leakedConnections = (int)perf.NextValue();
string instanceName = Assembly.GetEntryAssembly().GetName().Name; PerformanceCounter perf = new PerformanceCounter( ".NET Data Provider for SqlServer", "NumberOfReclaimedConnections", instanceName, true); int leakedConnections = (int)perf.NextValue();
string instanceName = Assembly.GetEntryAssembly().FullName; PerformanceCounter perf = new PerformanceCounter( ".NET Data Provider for SqlServer", "NumberOfNonPooledConnections", instanceName, true); int leakedConnections = (int)perf.NextValue();
string instanceName = Assembly.GetEntryAssembly().GetName().Name; PerformanceCounter perf = new PerformanceCounter( ".NET Data Provider for SqlServer", "NumberOfNonPooledConnections", instanceName, true); int leakedConnections = (int)perf.NextValue();

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server database. You use the ADO.NET Entity
Framework to manage persistence-ignorant entities.
You create an ObjectContext instance named context. Then, you directly modify properties on several entities.
You need to save the modified entity values to the database.
Which code segment should you use?

Select the one correct answers
context.SaveChanges(SaveOptions.AcceptAllChangesAfterSave);
context.SaveChanges(SaveOptions.DetectChangesBeforeSave);
context.SaveChanges(SaveOptions.None);
context.SaveChanges();

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server database.
You load records from the Customers table into a DataSet object named dataset.
You need to retrieve the value of the City field from the first and last records in the Customers table.
Which code segment should you use?

Select the one correct answers
Dim dt As DataTable = dataset.Tables("Customers") Dim first As String = dt.Rows(0)("City").ToString() Dim last As String = dt.Rows(dt.Rows.Count - 1)("City").ToString()
Dim dt As DataTable = dataset.Tables("Customers") Dim first As String = dt.Rows(0)("City").ToString() Dim last As String = dt.Rows(dt.Rows.Count)("City").ToString()
Dim relationFirst As DataRelation = dataset.Relations(0) Dim relationLast As DataRelation = dataset.Relations(dataset.Relations.Count - 1) Dim first As String = relationFirst.childTable.Columns("City").ToString() Dim last As String = relationLast.childTable.Columns("City").ToString()
Dim relationFirst As DataRelation = dataset.Relations(0) Dim relationLast As DataRelation = dataset.Relations(dataset.Relations.Count) Dim first As String = relationFirst.childTable.Columns("City").ToString() Dim last As String = relationLast.childTable.Columns("City").ToString()

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server database.
You load records from the Customers table into a DataSet object named dataset.
You need to retrieve the value of the City field from the first and last records in the Customers table.
Which code segment should you use?

Select the one correct answers
DataTable dt = dataset.Tables["Customers"]; string first = dt.Rows[0]["City"].ToString(); string last = dt.Rows[dt.Rows.Count - 1]["City"].ToString();
DataTable dt = dataset.Tables["Customers"]; string first = dt.Rows[0]["City"].ToString(); string last = dt.Rows[dt.Rows.Count]["City"].ToString();
DataRelation relationFirst = dataset.Relations[0]; DataRelation relationLast = dataset.Relations[dataset.Relations.Count - 1]; string first = relationFirst.childTable.Columns["City"].ToString(); string last = relationLast.childTable.Columns["City"].ToString();
DataRelation relationFirst = dataset.Relations[0]; DataRelation relationLast = dataset.Relations[dataset.Relations.Count]; string first = relationFirst.childTable.Columns["City"].ToString(); string last = relationLast.childTable.Columns["City"].ToString();

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Microsoft ASP.NET application. The application connects to a Microsoft SQL Server database.
The application is hosted on a Web server along with other applications.
You need to secure the transmission of data between the application and the database. You need to achieve this goal without affecting other applications.
What should you do?

Select the one correct answers
Encrypt the connection string
Use encryption to store sensitive data in the database
Use Secure Sockets Layer (SSL) to establish connections to the database
Use Internet Protocol Security (IPSec) to secure the communication channel

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server database.
The application stores encrypted credit card numbers in the database.
You need to ensure that credit card numbers can be extracted from the database.
Which cryptography provider should you use?

Select the one correct answers
DSACryptoServiceProvider
AesCryptoServiceProvider
MD5CryptoServiceProvider
SHA1CryptoServiceProvider

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You use a TableAdapter object to load a DataTable object. The DataTable object is used as the data
source for a GridView control to display a table of customer information on a Web page.
You need to ensure that the application meets the following requirements:
"Load only new customer records each time the page refreshes.
"Preserve existing customer records.
What should you do?

Select the one correct answers
"Set the ClearBeforeFill property of the TableAdapter to false. "Use the Fill method of the TableAdapter.
"Set the ClearBeforeFill property of the TableAdapter to false. "Use the GetData method of the TableAdapter to create a new DataTable
"Set the ClearBeforeFill property of the TableAdapter to true. "Use the Fill method of the TableAdapter to load additional customers.
"Set the ClearBeforeFill property of the TableAdapter to true. "Use the GetData method of the TableAdapter to create a new DataTable

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application.
The application updates several Microsoft SQL Server databases within a single transaction.
You need to ensure that after a resource failure, you can manage unresolved transactions.
What should you do?

Select the one correct answers
Call the EnlistVolatile method of the Transaction class.
Call the EnlistDurable method of the Transaction class.
Call the Reenlist method of the TransactionManager class.
Call the RecoveryComplete method of the TransactionManager class

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You use the ADO.NET Entity Data Model (EDM) to define a Customer entity.
You need to add a new Customer to the data store without setting all the customer's properties.
What should you do?

Select the one correct answers
Call the Create method of the Customer object.
Call the CreateObject method of the Customer object.
Override the Create method for the Customer object.
Override the SaveChanges method for the Customer object