Home » [Free] Get all latest Microsoft 70-513 Actual Tests 191-200

[Free] Get all latest Microsoft 70-513 Actual Tests 191-200

Ensurepass

QUESTION 191

A Windows Communication Foundation (WCF) service is responsible for transmitting XML documents between systems.

 

The service has the following requirements:

 

clip_image002It must minimize the transmission size by attaching the XML document as is without using escape characters or base64 encoding.

clip_image002[1]It must interoperate with systems that use SOAP but are not built on the .NET platform.

 

You need to configure the service to support these requirements.

 

Which message encoding should you use?

 

A.

Binary message encoding

B.

MTOM (Message Transmission Optimization Mechanism) message encoding

C.

Text message encoding with message version set to none

D.

Text message encoding with message version set to SOAP 1.2

 

Correct Answer: B

 

 

QUESTION 192

A Windows Communication Foundation (WCF) service is self-hosted in a console application. The service implements the ITimeService service interface in the TimeService class. You need to configure the service endpoint for HTTP communication. How should you define the service and endpoint tags?

 

A.

Define the service tag as follows:

<service name=” ITimeService ” >

Define the endpoint tag as follows.

< endpoint kind =” TimeService “

address=”http://localhost:8080/TimeService”

binding=” wsHttpBinding “

contract=” ITimeService”/ >

B.

Define the service tag as follows:

<service name=” TimeService “>

Define the endpoint tag as follows.

< endpoint kind=” TimeService “

address=”http://localhost:8080/TimeService”

binding=” wsHttpBinding “

contract=” ITimeService ” / >

C.

Define the service tag as follows:

<service name=” ITimeService “>

Define the endpoint tag as follows.

< endpoint name=” TimeService “

address=”http://localhost:8080/TimeService”

binding=” wsHttpBinding “

contract=” ITimeService “/ >

D.

Define the service tag as follows:

<service name=” TimeService “>

Define the endpoint tag as follows.

<endpoint address=”http://localhost:8080/TimeService”

binding=” wsHttpBinding “

contract=” ITimeService “/ >

 

Correct Answer: D

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

QUESTION 193

You are modifying a Windows Communication Foundation (WCF) service that issues security tokens. The service is accessible through the named pipe protocol. No endpoints are added in the service code. The configuration file for the service is as follows. (Line numbers are included for reference only.)

 

clip_image004

 

You need to ensure that new and existing client applications can access the service through HTTP and named pipes. What should you do?

 

A.

Insert the following line at line 05.

<endpoint address=http://www.contoso.com

binding=”wsHttpBinding”

contract=”Contoso.TokenService” />

B.

Insert the following line at line 05.

<endpoint address=http://www.contoso.com

binding=”basicHttpBinding”

contract=”Contoso.TokenService” />

C.

Insert the following line at line 08.

<add baseAddress=”http://www.contoso.com” />

D.

Insert the following line at line 08.

<add baseAddress=”net.tcp://www.contoso.com:8090″ />

 

Correct Answer: C

 

 

QUESTION 194

A Windows Communication Foundation (WCF) service implements the following contract. (Line numbers are included for reference only.)

 

01 [ServiceContract]

 

02 public interface IDataAccessService

 

03 {

 

04 [OperationContract]

 

05 void PutMessage(string message);

 

06

 

07 [OperationContract]

 

08 [FaultContract(typeof(TimeoutFaultException)) ]

 

09 [FaultContract(typeof(FaultException) ) ]

 

10 stringf] SearchMessages(string search);

 

11 }

 

The implementation of the SearchMessages method throws TimeoutFaultException exceptions for database timeouts. The implementation of the SearchMessages method also throws an Exception for any other issue it encounters while processing the request. These exceptions are received on the client side as generic FaultException exceptions.

 

You need to implement the error handling code for SearchMessages and create a new channel on the client only if the channel faults. What should you do?

 

A.

Catch and handle both TimeoutFaultException and FaultException

B.

Catch both TimeoutFaultException and FaultException. Create a new channel in both cases.

C.

Catch and handle TimeoutFaultException.Catch FaultException and create a new channel.

D.

Catch and handle FaultException.Catch TimeoutFaultException and create a new channel.

 

Correct Answer: C

 

 

QUESTION 195

Your company has an existing Windows Communication Foundation (WCF) service. The following code segment is part of the service. (Line numbers are included for reference only.)

 

clip_image005

 

You need to ensure that AJAX client applications can access the service.

 

Which code segment should you insert at line 02?

 

clip_image007

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: A

 

 

QUESTION 196

You are developing a Windows Communication Foundation (WCF) service that contains the following operation contract.

 

<OperationContract()>

 

Function GetCustomerNames() As CustomerNames

 

The operation returns customer names.

 

You need to develop a definition for the operation contract that produces XML with the following structure:

 

clip_image009

 

Which code segment should you use

 

A.

<MessageContract(IsWrapped:=False)>

Public Class CustomerNames

B.

<MessageBodyMember()>

Public Names() As String

End Class

C.

<MessageContract(WrapperName:=””)>

Public Class CustomerNames

D.

<MessageBodyMember()>

Public Names() As String

End Class

E.

<DataContract()>

Public Class CustomerNames

<DataMember ()>

Public Names () As String

End Class

F.

<DataContract()>

Public Class CustomerNames

<DataMember(IsRequired:=False)>

Public Names() As String

End Class

 

Correct Answer: A

 

 

QUESTION 197

You are developing a Windows Communication Foundation (WCF) service. Client applications require reliable sessions to access the service. Users report that they receive ServerTooBusyException errors when their client application tries to establish a session. You need to ensure that the service can handle a minimum of 30 client connection requests. Which ReliableSessionBindingElement property should you configure?

 

A.

MaxRetryCount

B.

MaxTransferWindowSize

C.

MaxPendingChannels

D.

InactivityTimeout

 

Correct Answer: C

 

 

QUESTION 198

You implement a Windows Communication Foundation (WCF) service. The service is hosted in Internet Information Services (IIS). The service must use X.509 certificates to authorize specific methods. You need to configure the service. What should you do? (Each correct answer presents part of the solution. Choose two.)

 

A.

Set the value of the Name property of the PrincipalPermissionAttribute to the identity of the certificate.

B.

Set the value of the ControlEvidence property of the SecurityPermissionAttribute to the identity of the certificate.

C.

In the web.config file for the service, in the serviceAuthorization element, set the value of the PrincipalPermissionMode attribute to UseAspNetRoles.

D.

In the web.config file for the service, in the serviceAuthorization element, set the value of the PrincipalPermissionMode attribute to UseWindowsGroups.

 

Correct Answer: AC

Explanation:

A:

You can use the PrincipalPermissionAttribute class to control access to a method if the client credential type is a certificate. To do this, you must have the certificate’s subject and thumbprint.

 

Example:

// Only a client authenticated with a valid certificate that has the // specified subject name and thumbprint can call this method.

[PrincipalPermission(SecurityAction.Demand,

Name = “CN=ReplaceWithSubjectName;

123456712345677E8E230FDE624F841B1CE9D41E”)]

public double Multiply(double a, double b)

{

return a * b;

}

 

C:

Example:

Set the PrincipalPermissionMode property to UseAspNetRoles as shown in the following configuration example:

 

<behaviors>

<serviceBehaviors>

<behavior name=”SvcBehavior1″>

<serviceAuthorization principalPermissionMode=”UseAspNetRoles” />

</behavior>

</serviceBehaviors>

</behaviors>

 

Setting this value to UseAspNetRoles indicates that the Name property of the PrincipalPermissionAttribute will be used to perform a string comparison. When a certificate is used as a client credential, by default WCF concatenates the certificate common name and the thumbprint with a semicolon to create a unique value for the client’s primary identity. With UseAspNetRoles set as the PrincipalPermissionMode on the service, this primary identity value is compared with the Name property value to determine the access rights of the user.

 

 

QUESTION 199

You are creating a Windows Communication Foundation (WCF) service that responds using plain-old XML (POX).

 

You have the following requirements:

 

clip_image002[2]You must enable the /catalog.svc/items operation to respond using the POX, JSON, or ATOM formats. You also must ensure that the same URL is used regardless of the result type.

clip_image002[3]You must determine the response format by using the Accepts HTTP header.

 

What should you do?

 

A.

Implement the IChannelInitializer interface in the service class.

B.

Implement the System.Runtime.Serialization.IFormatterConverter interface in the service class.

C.

Set the BodyStyle parameter of the WebGet attribute on the operation to WebMessageBodyStyle.WrappedResponse.

D.

Set the return type of the operation to System.ServiceModel.Channels.Message. Use the current WebOperationContext methods to return the data in the required format.

 

Correct Answer: D

 

 

QUESTION 200

You are developing a Windows Communication Foundation (WCF) service.

 

One of the service operations contains the following code:

 

private static int counter = 0;

 

[OperationContract]

 

public void IncrementCount()

 

[

 

counter++;

 

}

 

You need to set a service behavior that prevents two or more threads from incrementing the counter variable at the same time.

 

Which code segment should you use to set the service behavior?

 

A.

[ServiceBehavior(

InstanceContextMode = InstanceContextMode.Single,

ConcurrencyMode = ConcurrencyMode.Single)]

B.

[ServiceBehavior(

InstanceContextMode = InstanceContextMode.PerSession,

ConcurrencyMode = ConcurrencyMode.Single)]

C.

[ServiceBehavior(

InstanceContextMode = InstanceContextMode.Single,

ConcurrencyMode = ConcurrencyMode.Hultiple)]

D.

[ServiceBehavior(

InstanceContextMode = InstanceContextMode.PerCall,

ConcurrencyMode = ConcurrencyMode.Reentrant)]

 

Correct Answer: A

 

Instant Access to Download Testing Software & PDF File for Microsoft 70-513 Real Exam

Instant Access to Try Microsoft 70-513 Free Demo

HOT EXAM!

Name of author

Name: admin