Latest MCTS 70-513 Dumps Real Exam Download 61-70

Ensurepass

QUESTION 61

Four Windows Communication Foundation (WCF) services are hosted in Microsoft Internet Information Services (IIS). No behavior configuration exists in the web.config fiIe. You need to configure the application so that every service and endpoint limits the number of concurrent calls to 50 and the number of concurrent sessions to 25.

Which XML segment should you add to the system.serviceModel configuration section of the web.config file?

 

A.            <behaviors> <serviceBehaviors> <behavior name=”*”> <serviceThrottling maxConcurrentCalls=”50″ maxConcurrentSessions=”25″/></behavior>

</serviceBehaviors>

</behaviors>

B.            <behaviors> <serviceBehaviors>

 <behavior name=”default”>

 <serviceThrottling maxConcurrentCalls=”50″ maxConcurrentSessions=”25″/>

 </behavior>

</serviceBehaviors>

</behaviors>

C.            <behaviors> <serviceBehaviors> <behavior name=””> <serviceThrottling maxConcurrentCalls=”50″ maxConcurrentSessions=”25″/></behavior>

</serviceBehaviors>

</behaviors>

D.            <behaviors> <serviceBehaviors> <behavior name=”ALL”> <serviceThrottling maxConncurentCalls=”50″ maxConcurrentSessions=”25″ /></behavior>

</serviceBehaviors>

</behaviors>

 

Correct Answer: C

Explanation/Reference:

According to Darth, name=”” behaves the same as without specifying it at all.

The <behavior> Element

Each behavior element is identified by a name attribute and provides either a system-provided behavior, such as <throttling>, or a custom behavior. If no name is given then that behavior element corresponds to the default service or endpoint behavior.

<serviceThrottling>

Specifies the throttling mechanism of a Windows Communication Foundation (WCF) service.

maxConcurrentCalls

A positive integer that limits the number of messages that currently process across a ServiceHost.

Calls in excess of the limit are queued. Setting this value to 0 is equivalent to setting it to Int32.MaxValue.

The default is 16.

maxConcurrentInstances

A positive integer that limits the number of InstanceContext objects that execute at one time across a ServiceHost. Requests to create additional instances are queued and complete when a slot below the limit becomes available. The default is 16.

maxConcurrentSessions

A positive integer that limits the number of sessions a ServiceHost object can accept.

The service will accept connections in excess of the limit, but only the channels below the limit are active

(messages are read from the channel). Setting this value to 0 is equivalent to setting it to Int32.MaxValue.

The default is 10.

 

 

QUESTION 62

Windows Communication Foundation (WCF) service is self-hosted in a console application.

The service implements the lTimeService 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=”TimeService”>

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=”ITimeService” 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:

<senvice name=”TimeService”>

Define the endpoint tag as follows:

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

binding=”wsHttpBinding” contract=”ITimeService”/>

 

Correct Answer: D

Explanation/Reference:Specifying an Endpoint Address

(http://msdn.microsoft.com/en-us/library/ms733749.aspx)

 

 

QUESTION 63

Windows Communication Foundation (WCF) service will be hosted in Microsoft Internet Information Services (IIS). You create a new application in IIS to host this service and copy the service DLL to the bin directory of the application. You need to complete the deployment of this service to IIS. What should you do next?

 

A. Create an asmx file and add a @ServiceHost directive to this file. Copy the file to the root of the application directory.

B. Create an .asmx file and add a @Register directive to this file. Copy the file to the bin directoyy of the application.

C. Create a svc file and add a @ServiceHost directive to this file. Copy the file to the root of the application directory.

D. Create a .svc file and add a @Register directive to this file. Copy the file to the bin directory of the application.

 

Correct Answer: C

Explanation

Explanation/Reference:

How to: Host a WCF Service in IIS

(http://msdn.microsoft.com/en-us/library/ms733766.aspx)

“bin” deploy (preferred option)

1.

compile your WCF service into a DLL (class library)

2.

create a website in IIS6

3.

copy the WCF DLL’s into the website’s .bin folder

4.

create a *.svc file in that website

5.

add an appropriate web.config in the website folder to define your endpoints and service configuration etc.

Your WCF service will now be reachable at the website’s base address, plus the name of the *.svc file, e.g. http://myserver/someweb/Myservice.svc

Your *.svc would look something like this:

<%@ ServiceHost Language=”C#” Debug=”true” Service=”WCF_Simple_Service.HelloIndigoService” %>

The Service= attributes denotes the class implementing the service – fully qualified with its namespace.

 

 

QUESTION 64

You are developing a Windows Communication Foundation (WCF) service that will be hosted in Microsoft Internet Information Services (IIS) 7.0. The service must be hosted in an lIS application named Info. You need to enable this service to be hosted in llS by changing the web.config file. Which XML segment should you add to the web.config file?

 

A. <serviceHostingEnvironment>

 <senviceActivations>

 <add relativeAddress=”Info.svc” service=”Info” />

</serviceActivations>

</serviceHostingEnvironment>

B.            <serviceHostingEnvironment><serviceActivations> <add relativeAddress=”Info” service=”Info.svc” />

</serviceActivations>

</serviceHostingEnvironment>

C.            <serviceHostingEnvironment><transportConfigurationTypes><add name=”Info” transportConfigurationType=”Info.svc”/>

</transportConfigurationTypes>

</serviceHostingEnvironment>

D.            <serviceHostingEnvironment><transportConfigurationTypes><add name=”Info.svc” transportConfigurationType=”FileNotRequired” />

</transportConfigurationTypes>

<serviceHostingEnvironment>

 

Correct Answer: A

Explanation/Reference:

<serviceHostingEnvironment><serviceActivations> <add relativeAddress=”MyServiceAddress” service=”Service” factory=”MyServiceHostFactory”/></serviceActivations></serviceHostingEnvironment>

When using configuration-based activation, inline code in .svc files is not supported.

The relativeAddress attribute must be set to a relative address such as “<sub-directory>/service.svc” or “~/<sub-directory/service.svc”.

A configuration exception is thrown if you register a relative address that does not have a known extension associated with WCF.

The relative address specified is relative to the root of the virtual application.

Due to the hierarchical model of configuration, the registered relative addresses at machine and site level are inherited by virtual applications.

Registrations in a configuration file take precedence over settings in a .svc, .xamlx, .xoml, or other file.

Any ‘’ (backslashes) in a URI sent to IIS/WAS are automatically converted to a ‘/’ (forward slash).

If a relative address is added that contains a ‘’ and you send IIS a URI that uses the relative address, the backslash is converted to a forward slash and IIS cannot match it to the relative address. IIS sends out trace information that indicates that there are no matches found.

Configuration-Based Activation

(http://msdn.microsoft.com/en-us/library/dd807499.aspx)

 

 

QUESTION 65

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

You need to ensure that the service is compatible with ASP.NET to make use of the session state. Which binding should you use?

 

A. NetTcpContextBinding

B. BasicHttpContextBinding

C. NetTcpBinding

D. NetMsmqBinding

 

Correct Answer: B

Explanation/Reference:

Argument for BasicHttpContextBinding (http://msdn.microsoft.com/en-us/library/ff650724.aspx)

Use basicHttpBinding with transport security to ensure that the service is compatible with legacy ASMX clients.

How to: Configure WCF Service to Interoperate with ASP.NET Web Service Clients

(http://msdn.microsoft.com/en-us/library/ms731134.aspx)

<basicHttpContextBinding>

(http://msdn.microsoft.com/en-us/library/bb924439.aspx)

BasicHttpContextBinding <basicHttpContextBinding>

A binding that is suitable for communicating with WS-Basic Profile conformant Web services that enables HTTP cookies to be used to exchange context.

Services running in ASP.NET Compatibility mode participate fully in the ASP.NET application pipeline and can make use of ASP.NET features such as file/URL authorization, session state, and the HttpContext class.

The HttpContext class allows access to cookies, sessions, and other ASP.NET features.

This mode requires that the bindings use the HTTP transport and the service itself must be hosted in IIS.

ASP.NET Compatibility

(http://msdn.microsoft.com/en-us/library/ms752234.aspx)

 

 

QUESTION 66

A Windows Communication Foundation (WCF) client communicates with a service.

You created the client proxy by using Add Service Reference in MS Visual Studio.

You need to ensure that the client accepts responses of up to 5 MB in size. What should you change in the configuration file’?

 

A. the value of the maxBufferPoolSize attribute to 5242880

B. the value of the maxReceivedMessageSize attribute to 5242880

C. the value of the maxBytesPerRead attribute to 5242880

D. the value of the maxBufferSize attribute to 5242880

 

Correct Answer: B

Explanation/Reference:WSHttpBindingBase.MaxReceivedMessageSize Property

Gets or sets the maximum size for a message that can be processed by the binding.

Type: System.Int64

The maximum size, in bytes, for a message that is processed by the binding. The default value is 65,536 bytes.

 

 

QUESTION 67

An ASP.NET application hosts a RESTful Windows Communication Foundation (WCF) service at /Services/Contoso.svc.

The service provides a JavaScript resource to clients. You have an explicit reference to the JavaScript in your page markup as follows.

<script type=”text/javaScript” src=”/Services/Contoso.svc/js” />

You need to retrieve the debug version of the service JavaScript. What should you do?

 

A. In the <%@ ServiceHost %> header for /Services/Contoso.svc, set the Debug attribute to true.

B. In the <%@ Page %> header, set the Debug attribute to true.

C. In the script tag, add a debug attribute and set its value to true.

D. In the script tag, append debug to the src attribute.

 

Correct Answer: D

Explanation/Reference:

 

 

QUESTION 68

clip_image002

A. Create one FindCriteria object for each interface and set the Duration of each FindCriteria to 30 seconds. Call the FindAsync method of the DiscoveryClient class twice, one time for each of the FindCriteria objects, to search for the services.

B. Create one FindCriteria object for each interface and set the Duration of each FindCnteria to two seconds. Create a loop that calls the Find method of the DiscoveryClient class to search for the services. Within each loop iteration, call the Find method of the DiscoveryClient class once for each of the FindCriteria objects. Run the loop until a service is found or 30 seconds pass.

C. Create a single FindCriteria object and add both interfaces to its ContractTypeNames collection. Set the criteria’s Duration to two seconds. Create a loop that calls the Find method of the DiscoveryClient class to search for the services. Within each loop iteration, call the Find method of the DiscoveryClient class to search for the services Run the loop until a service is found or 30 seconds pass.

D. Create a single FindCritera object and add both interfaces to the ContractTypeNames collection. Set the Duration to 30 seconds and use the FindAsync method of the DiscoveryClient class to search for the services.

 

Correct Answer: B

Explanation/Reference:

I saw the answer D!!

FindCriteria

FindCriteria has several properties, which can be grouped into search criteria, which specify what services you are looking for, and find termination criteria (how long the search should last). A FindCriteria can contain multiple search criteria.

By default, the service has to match all of the components otherwise it does not consider itself a matching service.

If you want to find services that only match some of the criteria, you can implement custom find logic on the service or you can use multiple queries.

Search criteria include:

ContractTypeNames – Optional. The contract name of the service being searched for and the criteria typically used when searching for a service.                                   If more than one contract name is specified, only service endpoints matching ALL contracts reply. Note that in WCF an endpoint can only support one contract.

Scopes – Optional. Scopes are absolute URIs that are used to categorize individual service endpoints.                                   You may want to use this in scenarios where multiple endpoints expose the same contract and you want a way to search                                   for a subset of the endpoints. If more than one scope is specified, only service endpoints matching ALL scopes reply.

ScopeMatchBy – Specifies the matching algorithm to use while matching the scopes in the Probe message with that of the endpoint.

There are five supported scope-matching rules: ScopeMatchByExact does a basic case-sensitive string comparison.                  ScopeMatchByPrefix matches by segments separated by “/”. A search for http://contoso/building1 matches a service with scope http://contoso/building/floor1.

                                                Note that it does not match http://contoso/building100 because the last two segments do not match.

 ScopeMatchByLdap matches scopes by segments using an LDAP URL.

 ScopeMatchByUuid matches scopes exactly using a UUID string.

 ScopeMatchByNone matches only those services that do not specify a scope.

 If a scope-matching rule is not specified, ScopeMatchByPrefix is used.

Termination criteria include:

Duration – The maximum time to wait for replies from services on the network. The default duration is 20 seconds.

MaxResults – The maximum number of replies to wait for. If MaxResults replies are received before Duration has elapsed, the find operation ends.

Discovery Find and FindCriteria

(http://msdn.microsoft.com/en-us/library/ee816866.aspx)

 

 

QUESTION 69

A Windows Communication Foundation (WCF) service sends notifications when the service is started and stopped. You need to implement a client that logs these notifications. Which class should you use?

 

A. AnnouncementService

B. AnnouncementClient

C. DiscoveryClient

D. HttpListener

 

Correct Answer: A

Explanation/Reference:AnnouncementService Class

(http://msdn.microsoft.com/en-us/library/system.servicemodel.discovery.announcementservice.aspx)

AnnouncementEndpoint Class

(http://msdn.microsoft.com/en-us/library/system.servicemodel.discovery.announcementendpoint.aspx)

AnnouncementService

This class listens for incoming messages on a standard announcement endpoint (AnnouncementEndpoint) and provides event notification when Hello or Bye announcement messages arrive.

You can provide a custom announcement service implementation by deriving from this class.

 

 

QUESTION 70

You are using Windows Communication Foundation (WCF) to create a service.

You need to implement a custom message-level security binding element. Which binding element should you use?

 

A. TransportSecurityBindingElement

B. HttpsTransportBindingElement

C. SslStreamSecuntyBindingElement

D. WindowsStreamSecurityBindingElement

 

Correct Answer: A

Explanation/Reference:

Three binding elements relate to message level security, all of which derive from the SecurityBindingElement class.

The three are TransportSecurityBindingElement, SymmetricSecurityBindingElement, and AsymmetricSecurityBindingElement.

The TransportSecurityBindingElement is used to provide Mixed mode security. The other two elements are used when the message layer provides security.

Additional classes are used when transport level security is provided:

HttpsTransportBindingElement

SslStreamSecurityBindingElement

WindowsStreamSecurityBindingElement

How to: Create a Custom Binding Using the SecurityBindingElement

(http://msdn.microsoft.com/en-us/library/ms730305.aspx)

 

 

Download Latest MCTS 70-513 Real Free Tests , help you to pass exam 100%.