Ensurepass

QUESTION 271

You are developing a data contract for a Windows Communication Foundation (WCF) service. The data in the data contract must participate in round trips. Strict schema validity is not required. You need to ensure that the contract is forward-compatible and allows new data members to be added to it. Which interface should you implement in the data contract class?

 

A.

ICommunicationObject

B.

IExtension<T>

C.

IExtensibleObject<T>

D.

IExtensibleDataObject

 

Correct Answer: D

 

 

QUESTION 272

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

 

[ServiceContract| public interface IHelloService { [OperationContract] [VVebGet(UriTemplate =

 

“hello?namee{name}”)] string SayHello(string name);

 

}

 

The implementation is as follows.

 

public class HelloService: IHelloService { public string SayHello(string name)

 

{ return “Hello “.+ name;

 

}

 

}

 

The senvice is self-hosted, and the hosting code is as follows.

 

WebServiceHost svcHost = CreateHoseO;

 

svcHost.OpenO;

 

Console. ReadLineO;

 

SrvHost.CloseO;

 

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

 

http://localhost:8000/HelloService which code segment should you use?

 

A.

WebServiceHost svcHost new WebServiceHost(typeof(HelloService));

svcHost.AddServiceEndpoint(typeof(lHelloService),

new WebHttpBinding(WebHttpSecurityMode None),

“http://localhost:8000/HelloService”);

return svcHost;

B.

Ur baseAddress = new Urit’http:I/localhost:800O1″);

WebServiceHost svc Host new WebServiceHost(typeof(HelloService), baseAddress);

svcHostAddServiceEndpoint(typeof(lHelloService),

new WebHttpBinding(WebHttpSecurityMode. None),

“HelloService”); return svc Host;

C.

WebServiceHost svcHost = new Web Service Host(new HelloServiceO);

svcHost AddServiceEndpoint(typeof(lHelloService),

new WebHttpBinding(WebHttpSecurityMode. None),

“http://Iocalhost: 8000/HelloService”);

return svcHost

D.

Ur baseAddress new Uri(‘http //Iocalhost 8000/”); WebServiceHost svc Host =

new WebServiceHost(new HelloService0, baseAddress),

svc Host.AddServiceEndpoint(typeof(IHelloService),

new WebHttpBinding(WebHttpSec urityMode None),

“HelloService”);

retumn svc Host;

 

Correct Answer: A

 

 

QUESTION 273

DRAG DROP

You create a Windows Communication Foundation (WCF) service. The service uses a federated security architecture.

 

The architecture consists of the following components:

 

clip_image002[31]Order service

clip_image002[32]Store security token service (STS)

clip_image002[33]Home security token service (STS)

clip_image002[34]Order client application

 

The Order service includes the following markup:

 

clip_image003[7]

 

The Store service includes the following markup:

 

clip_image004[7]

 

You have the following requirements:

 

clip_image002[35]The Order service requires authentication to access any of the service operations.

clip_image002[36]The Order service must redirect all client application authentication requests to the Store STS.

clip_image002[37]The Store STS must redirect all client application authentication requests to the Home STS.

 

You need to configure the sequence of events that occur when the client application accesses an Order service operation.

 

Which six actions should you perform in sequence? (To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.)

 

clip_image006[7]

 

Correct Answer:

clip_image008[7]

 

 

QUESTION 274

You are developing a Windows Communication Foundation (WCF) service that must be discoverable. You need to ensure that the ServiceHost instance supports multiple discovery versions. What should you do?

 

A.

Specify a unique DiscoveryVersion parameter for each endpoint constructor.

Use the same value for the Address property of each endpoint.

B.

Use the endpoint constructor without the DiscoveryVersion parameter.

Use a unique value for the Address property of each endpoint.

C.

Specify a unique DiscoveryVersion parameter for each endpoint constructor.

Use a unique value for the Address property of each endpoint.

D.

Use the endpoint constructor without the DiscoveryVersion parameter.

Use the same value for the Address property of each endpoint.

 

Correct Answer: C

 

 

QUESTION 275

You have a Windows Communication Foundation (WCF) service that accepts the following message contract.

 

clip_image009[7]

 

You need to ensure that the client sends a SOAP body that is accepted by the service.

 

A.

<Ticket xmlns=”http://www.movies. com”>

<NumberOfSeats

xmlns=”http : //www.movietheater . com”>

0

</NumberOfSeats>

<ReservationName xmlns=”http://www.movietheater .com” />

<ShowTime

xmlns=”http://www.movietheater.com”>

2010-07-05T00:SI:10.0999304-05:00

</ShowTime>

</Ticket>

B.

<Ticket xmlns=”http://www.movietheater.com”>

<ShowTime

xmlns=”http : //www.movietheater . com”>

2010-07-05T00:51:10.0999304-05:00

</ShowTime>

<ReservationName xmlns=”http://www.movietheater.com” />

<NumberOfSeats

xmlns=”http://www.movietheater.com”>

0

</NumberOfSeats>

</Ticket>

C.

<Ticket xmlns=”http://wwv.movies.com”>

<ShowTime

xmlns-“http://www.movietheatec.com”>

2010-07-05TOO:51:10.0999304-05:00

</ShowTime>

<Number Of Seats

xmlns=”http://www.movietheater.com”>

0

</NumbecOfSeats>

<ReservationName xmlns””http://www.movietheotec.com” />

</Ticket>

D.

<Ticket xmlns=”http://www. movietheatec.com”>

<ShowTime

xmlns-“http://www.movietheater.com”>

2010-07-05TOO:51:10.0999304-05:00

</ShowTime>

<NumberOfSeats

xmlns=”http://wwv.movietheatec.com”>

0

</NumberOfSeats>

<ReservationName

xmlns=”http://www.movletheatec.com” />

</Ticket>

 

Correct Answer: C

 

 

QUESTION 276

You are creating a Windows Communication Foundation (WCF) service. You do not want to expose the internal implementation at the service layer.

 

You need to expose the following class as a service named Arithmetic with an operation named Sum.

 

Public Class Calculator

 

Public Function Add

 

(ByVal x As Integer,

 

ByVal y As Integer) As Integer

 

End Function

 

End Class

 

Which code segment should you use?

 

A.

<ServiceContract(Namespace:=”Arithmetic”)>

Public Class Calculator

<OperationContract(Action:=”Sum”)>

Public Function Add(ByVal x As Integer,

ByVal y As Integer) As Integer

End Function

End Class

B.

<ServiceContract(ConfigurationName:=”Arithmetic”)>

Public Class Calculator

<OperationContract(Action:=”Sum”)>

Public Function Add(ByVal x

As Integer,

ByVal y As Integer) As Integer

End Function

End Class

C.

<ServiceContract(Name:=”Arithmetic”)>

Public Class Calculator

<OperationContract(Name:=”Sum”)>

Public Function Add(ByVal x As Integer,

ByVal y As Integer) As Integer

End Function

End Class

D.

<ServiceContract(Name:=”Arithmetic”)>

Public Class Calculator

<OperationContract(ReplyAction:=”Sum”)>

Public Function Add(ByVal x As Integer,

ByVal y As Integer) As Integer

End Function

End Class

 

Correct Answer: C

 

 

QUESTION 277

You are developing a custom service host for a Windows Communication Foundation (WCF) service. The service host is named MovieServiceHost. You need to deploy the service with the custom service host in Microsoft Internet Information Services (IIS) 7.0. What should you do?

 

A.

Create a factory for the custom service host. Name the factory MovieServiceHostFactory.

In the web.config file, add the following attribute to the <add> element within the <serviceActivations> element, factory=”HovieServiceHostFactory”

B.

Decorate the custom service host class with the following line.

<System.ServiceModel.Activation.ServiceActivationBuildProvider()>

C.

Make sure that the service class has a default constructor.

Add a public read-only property with the name ServiceHost that returns an instance of the MovieServiceHost class.

D.

Create a factory for the custom service host. Name the factory MovieServiceHostFactory.

In the .svc file, add the following line. <%3 ServiceHost Service=”MovieServiceHostFactory” Language=”VB”%>

 

Correct Answer: A

 

 

 

 

 

 

 

QUESTION 278

You are hosting a Windows Communication Foundation (WCF) service under Microsoft Internet Information Services (IIS) 7.0.

 

You have set up a Web site in IIS Manager. The physical path is C:\wwwroot\Calendar. There is a Calendar.svc file in the C:\wwwroot\Calendar folder. It contains the following directive:

 

<%@ ServiceHost Language=”C#” Debug=”true” Service=”Calendar.Calendar” CodeBehind=”Calendar.svc.cs” %>

 

The Calendar.svc.cs file contains the source for the Calendar class in the Calendar namespace. You compile this code into the Calendar.dll file.

 

You need to deploy your service to the Web site.

 

What should you do?

 

A.

Copy the Calendar.dll file to the C:\wwwroot\Calendar\code folder.

B.

Copy the Calendar.dll file to the C:\wwwroot\Calendar\bin folder.

C.

Copy the Calendar.svc.cs file to the C:\wwwroot\Calendar\bin folder.

D.

Copy the Calendar.svc.cs file to the C:\wwwroot\Calendar\code folder.

 

Correct Answer: B

 

 

QUESTION 279

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:

 

void DeleteItems(string id);

 

You need to configure WCF to call this method when the client calls the service with the HTTP DELETE operation.

 

What should you do?

 

A.

Add the WebInvoke(UriTemplate = “/Items/{id}”, Method=”DELETE”) attribute to the operation.

B.

Add the HttpDelete attribute to the operation.

C.

Replace the string parameter with a RemovedActivityAction parameter.

D.

Replace the return type with RemovedActivityAction.

 

Correct Answer: A

 

 

 

 

 

 

 

 

 

 

 

QUESTION 280

You are creating a Windows Communication Foundation (WCF) service that accepts messages from clients when they are started. The message is defined as follows.

 

[MessageContract]

 

public class Agent

 

{

 

public string CodeName { get; set; }

 

public string SecretHandshake { get; set; }

 

}

 

You have the following requirements:

 

clip_image002[38]The CodeName property must be sent in clear text. The service must be able to verify that the property value was not changed after being sent by the client.

clip_image002[39]The SecretHandshake property must not be sent in clear text and must be readable by the service.

 

What should you do?

 

A.

Add a MessageBodyMember attribute to the CodeName property and set the ProtectionLevel to Sign.

Add a MessageBodyMember attribute to the SecretHandshake property and set the ProtectionLevel to EncryptAndSign.

B.

Add a DataProtectionPermission attribute to the each property and set the ProtectData property to true.

C.

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.

D.

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.

 

Correct Answer: A

 

Instant Access to Download Latest Complete Collection of Microsoft 70-513 Real Exam

Try Microsoft 70-513 Free Demo