PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

What should you do ?

You are developing and XBAP application for your company intranet. During several development iterations, you manually.. executable, application, and deployement manifest to the test Web Server. You create an HTML file that has a .. manifest that you use for testing. During the next iteration, you enchance the XBAP application by making changes..

When you use the hyperlink to the deployment manifest to test the deployment, you do not see the changes.

You need to ensure that the changes you make are visible when you test the deployment from your machine.

What should you do ?

You need to implement CreateHost so that the service has a single endpoint hosted at…

A Windows Communication Foundation (WCF) service implements the following contract.

[ServiceContract]
public interface IHelloService
{
[OperationContract(WebGet(UriTemplate=”hello?name={name}”))]
string SayHello(string name);
}

The implementation is as follows:

public class HelloService: IHelloService
{
public string SayHello(string name)
{
return “Hello ” + name;
}
}

The service is self-hosted, and the hosting code is as follows:

WebServiceHost svcHost = CreateHost();
svcHost.Open();
Console.ReadLine();
svcHost.Close();

You need to implement CreateHost so that the service has a single endpoint hosted at http://localhost:8000/HelloService.
Which code segment should you use?

What should you do?

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You create a Button control for the application.
You need to ensure that the application meets the following requirements:
When the mouse pointer is over the Button control, the background color of the button is set to red and
the Button control appears bigger.
When the mouse pointer is not over the Button control, the button returns to its original state.
What should you do?

Which line of code should you insert at line 04?

A Windows Communication Foundation (WCF) service is self-hosted in a console application.
The service implements the IDataAccess contract, which is defined in the MyApplication namespace.
The service is implemented in a class named DataAccessService which implements the IDataAccess
interface and also is defined in the MyApplication namespace. The hosting code is as follows.
(Line numbers are included for reference only.)

01 static void Main(string[] args)
02 {
03 ServiceHost host;
04 …
05 host.Open();
06 Console.ReadLine();
07 host.Close();
08 }

You need to create a ServiceHost instance and assign it to the host variable. You also need to instantiate the service host.
Which line of code should you insert at line 04?

What should you do?

You are developing a Windows Presentation Foundation (WPF) application.

An event triggers a workflow such that a parent control executes the event handlers before the child controls.

You need to ensure that if a parent controls event handler encounters an error, the subsequent handlers are not called.

What should you do?

What should you add to constructor of the main window ?

You are developing a Windows Presentation Foundation (WPF) application to play audio files. You add MediaElement mediaElement1 and a Button control named btnPlayAudio to the design surface. The MediaElement co.. audio file. The LoadedBehavior attribute is set to Manual.

You add the following code to the main Window.

void playCommand_Executed(object sender, RoutedEventArgs e)
{
mediaElement1.Play();
}

You set the command of the button to MediaCommands.Play.

You need to ensure that the application will play the audio file when the button is pressed.

What should you add to constructor of the main window ?

What should you do?

A Windows Communication Foundation (WCF) service listens for messages at net.tcp://www.contoso.com/MyService.
It has a logical address at http://www.contoso.com/MyService. The configuration for the WCF client is as follows:

<endpoint address=”http://www.contoso.com/MyService”
binding=”netTcpBinding”
bindingConfiguraton=”NetTcpBinding_IMyService”
contract=”ServiceReference1.IMyService”
name=”NetTcpBinding_IMyService”/>

The generated configuration does not provide enough information for the client to communicate with the server.
You need to update the client so that it can communicate with the server. What should you do?