Latest MCTS 70-513 Dumps Real Exam Download 81-90

Ensurepass

QUESTION 81

You are using tracing to diagnose run-time issues.When you look at the traces for the service in SvcTraceViewer.exe, you see what is shown in the exhibit:

The exception trace is selected in SvcTraceViewer.exe. You need to interpret the trace results to determine where the error occurred and what to do next. What should you do?

 

A. This issue occurred in the ServiceHost during ServiceHost.Open(). Enable WMI by adding the following configuration to the system.serviceModel configuration section in the application configuration file

<diagnostics wmiProviderEnabled=”true”/>

Restart the application and inspect the endpoints visible through WMI.

B. This issue occurred in the ServiceHost during ServiceHost.Open(). Compare the security settings for any endpoints that use an MSMQ transport to the security configuration of the MSMQ queue used by the endpoint.

C. This issue occurred at the ServiceHost when receiving a message. Compare the security configurations on the client and server to make sure that they are compatible.

D. This issue occurred at the ServiceHost when accepting an initial set of messages from MSMQ. Log all messages sent between the client and the sever.

 

Correct Answer: B

Explanation/Reference:

 

 

QUESTION 82

You are adding a Windows Communication Foundation (WCF) service to an existing application. The application is configured as follows. (Line numbers are included for reference only)

01 <configuration>

02 <system.serviceModel>

03 <services>

04 <service name=”Contoso.Sales.Stock.Service”

05 behaviorConfiguration=”MetadataBehavior”>

06 <host>

07 <baseAddresses>

08 <add baseAddress=”http://contosso.com:8080/StockService” />

09 </baseAddresses>

10 </host>

11 </service>

12 </services>

13 <behaviors>

14 <serviceBehaviors>

15 <behavior name=”MetadataBehavior”>

16 </behavior>

17 </serviceBehaviors>

18 </behaviors>

19 …

You need to configure the service to publish the service metadata.

Which two actions should you perform? (Each answer presents part of the solution. Choose two.)

 

A. Add the following XML segment between lines 10 and 11:

<endpoint address=”” binding=”mexHttpBinding” contract=”MetadataExchange” />

B. Add the following XML segment between lines 10 and 11:

<endpoint address=”” binding=”basicHttpBinding” contract=”MetadataExchange” />

C. Add the following XML segment between lines 15 and 16:

<serviceDiscovery>

<anouncementEndpoints>

<endpoint address=””/>

</anouncementEndpoints>

</serviceDiscovery>

D. Add the following XML segment between lines 15 and 16:

<serviceMetadata httpGetEnabled=”true” />

 

Correct Answer: AD

Explanation/Reference:<mexHttpBinding>

Specifies the settings for a binding used for the WS-MetadataExchange (WS-MEX) message exchange over HTTP. This binding is essentially a WSHttpBinding binding with security disabled. It supports most metadata requests.

<serviceMetadata> Specifies the publication of service metadata and associated information. httpGetEnabled              A Boolean value that specifies whether to publish service metadata for retrieval using an HTTP/Get request. The default is false.

<serviceMetadata>

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

<mexHttpBinding>

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

 

 

QUESTION 83

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)

01 <configuration>

02 <system.serviceModel>

03 <services>

04 <service name=”Contoso.TokenService”>

05 …

06 <host>

07 <baseAddress>

08 …

09 <add baseAddress=”net.pipe://www.contoso.com/tokenpipe” />

10 <baseAddress>

11 </host>

12 </service>13 </services>14 </system.serviceModel>15 </configuration>

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

 

A. Insert the following at line 05:

<endPoint address=”http://www.contoso.com” binding=”wsHttpBinding” contract=”Contoso.TokenService” />

B. Insert the following at line 05:

<endPoint address=”http://www.contoso.com” binding=”basicHttpBinding” contract=”Contoso.TokenService” />

C. Insert the followin at line 08:

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

D. Insert the followin at line 08:

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

 

Correct Answer: C

Explanation/Reference:

You can also have multiple base addresses for a service, but each service is allowed only one base address for each transport.

If you have multiple endpoints, each of which is configured with a different binding, their addresses must be unique.

Endpoints that use the same binding but different contracts can use the same address.

Specifying an Endpoint Address

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

EXAMPLE:

if you have two base addresses, say:

http://localhost:9000/servicenet.tcp://localhost:9001/service

and three endpoints

endpoint 1: address=”LOB” binding=”basicHttpBinding”, contract = …endpoint 2: address=”LOB” binding=”netTcpBinding”, contract = …endpoint 3: address=”management” binding=”wsHttpBinding”, contract = …

then they will be exposed at the following addresses irrespective of what order you declare them

endpoint 1: http://localhost:9000/service/LOBendpoint 2: net.tcp://localhost:9001/service/LOBendpoint 3: http://localhost:9000/service/management

 

 

QUESTION 84

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

You have set up a web site in IIS Manager. The physical path is c:wwwrootCalendar.

There is a Calendar.svc file in the c:wwwrootCalendar folder. It contains the following directive:

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

The CalendarSvc.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:wwwrootCalendarcode folder

B. Copy the Calendar.dll file to the c:wwwrootCalendarbin folder

C. Copy the Calendar.svc.cs file to the c:wwwrootCalendarbin folder

D. Copy the Calendar.svc.cs file to the c:wwwrootCalendarcode folder

 

Correct Answer: B

Explanation/Reference:

There are basically two options of WCF deployment in IIS:

Option 1 – “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.

Option 2 – put stuff into App_Code

1. create a website in IIS6

2. put all your WCF related *.cs files directly into the .App_Code folder

3. create a *.svc file in that website

4. 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=”Service”CodeBehind=”~/App_Code/Service.cs” %>

A simple, sample web.config might look something like this:

<system.serviceModel><behaviors> <serviceBehaviors>

 <behavior name=”WithDebug”>

<serviceMetadata httpGetEnabled=”true” />

<serviceDebug includeExceptionDetailInFaults=”true” />

</behavior>

</serviceBehaviors>

</behaviors>

<serviceHostingEnvironment multipleSiteBindingsEnabled=”true” />

<services>

 <service name=”SimpleWCF.HelloIndigoService” behaviorConfiguration=”true”>

<endpoint

address=””

 binding=”basicHttpBinding”

contract=”SimpleWCF.IHelloIndigoService” />

<endpoint

address=”mex”

 binding=”mexHttpBinding”

contract=”IMetadataExchange” />

</service></services></system.serviceModel>

You basically define your <service> tag – and again: the name= denotes the class implementing the service – fully qualified with its namespace.

It must contain at least one endpoint – since IIS6 only support HTTP, you can use basicHttpBinding or wsHttpBinding and that’s about all there is.

A “mex” endpoint is optional – but very useful, especially for development and testing.

It allows client to “discover” the service and get its service description so it can interface with it.

Once your service is deployed in IIS, you can see it in action using a tool like the WCF Test Client that ships for free with WCF,

or SoapUI which is a general-purpose SOAP testing utility (with a free edition for you to use).

 

 

QUESTION 85

clip_image002

A.            HostInstance Credentials.ServiceCertificate SetCertificate(StoreLocation.LocalMachine, StoreName.My,x509FindType.FindBySubjectName, “CN=”TaxServiceKey”);

B.            HostInstance Credentials.ServiceCertificate SetCertificate(StoreLocation.LocalMachine, StoreName.AuthRoot,x509FindType.FindBySubjectName, “CN=”TaxServiceKey”);

C.            HostInstance Credentials.ServiceCertificate SetCertificate(StoreLocation.LocalMachine, StoreName.My,x509FindType.FindByDistinguishedName, “CN=”TaxServiceKey”);

D.            HostInstance Credentials.ServiceCertificate SetCertificate(StoreLocation.LocalMachine, StoreName.Root,x509FindType.FindByDistinguishedName, “CN=”TaxServiceKey”);

 

Correct Answer: D

Explanation/Reference:StoreName Enumeration

Specifies the name of the X.509 certificate store to open.

StoreName Enumeration

(http://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.storename.aspx)

AddressBook The X.509 certificate store for other users. AuthRoot The X.509 certificate store for third-party certificate authorities (CAs). CertificateAuthority The X.509 certificate store for intermediate certificate authorities (CAs). Disallowed The X.509 certificate store for revoked certificates. My The X.509 certificate store for personal certificates. Root The X.509 certificate store for trusted root certificate authorities (CAs). TrustedPeople The X.509 certificate store for directly trusted people and resources. TrustedPublisher The X.509 certificate store for directly trusted publishers.

X509FindType Enumeration

(http://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.x509findtype(v=vs.85).aspx)

FindBySubjectName The findValue parameter for the Find method must be a string representing the subject name of the certificate.                                     This is a less specific search than if you use the FindBySubjectDistinguishedName enumeration value.                                     Using the FindBySubjectName value, the Find method performs a case-insensitive string compare using the supplied value.                                     For example, if you pass “MyCert” to the Find method, it will find all certificates with the subject name containing that string,                                     regardless of other subject values. Searching by distinguished name is a more precise search.

FindBySubjectDistinguishedName    The findValue parameter for the Find method must be a string representing the subject distinguished name of the certificate. This is a more specific search than if you use the FindBySubjectName enumeration value.                                     Using the FindBySubjectDistinguishedName value, the Find method performs a case-insensitive string compare for the entire distinguished name. Searching by subject name is a less precise search.

 

 

QUESTION 86

You are hosting a Windows Communication Foundation (WCF) service at http://www.contoso.com for a law enforcement agency.

The agency adds operations to support sending biometric fingerprint data via non-buffered streaming.

The service data is routed between intermediaries. The WCF binding you are using by default does not support encryption.

You need to ensure that the fingerprint data is not disclosed when passed over the network. What should you do?

 

A. Use basicHttpBinding with message security to https://www.contoso.com

B. Use basicHttpBinding with transport security to https://www.contoso.com

C. Use wsHttpBinding with message security to https://www.contoso.com

D. Use wsHttpBinding with transport security to http://www.contoso.com

 

Correct Answer: B

Explanation/Reference:

 

 

QUESTION 87

You create a Windows Communication Foundation (WCF) service and deploy it with wsHttpBinding and message security enabled.

You create an intermediate WCF service for logging messages sent to the primary service.

The intermediate service is called via endpoint behaviour. The primary service is receiving malformed data from a client application.

You need to enable inspection of the malformed data and prevent message tampering. What do you do?

 

A. Specify a protection level of None in the contract for the intermediate service. Disable message and transport security from the client application configuration file.

B. Specify a protection level of Sign in the contract for the intermediate service. Disable transport security from the client application configuration file.

C. Modify the binding on the intermediate service to use netNamedPipeBinding.

D. Modify the binding on the intermediate service to use webHttpBinding.

 

Correct Answer: B

Explanation/Reference:ProtectionLevel Indicates the security services requested for an authenticated stream. Sign Sign data to help ensure the integrity of transmitted data. None Authentication only.

<webHttpBinding>

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

<webHttpBinding> Defines a binding element that is used to configure endpoints for Windows Communication Foundation (WCF) Web services that respond to HTTP requests instead of SOAP messages.

<netNamedPipeBinding>

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

<netNamedPipeBinding>

Defines a binding that is secure, reliable, optimized for on-machine cross process communication.

 

 

QUESTION 88

You develop a Windows Communication Foundation (WCF) service. You enable all performance counters and run multiple calls to the service.

The service must isolate session data to each user. You need to monitor the instancing behaviour used in the service.

Which performance counter should you monitor?

 

A. ServiceModeService 4.0.0.0Calls

B. ServiceModeService 4.0.0.0Instances

C. ASP.Net StateService Server Sessions Active

D. ASP.Net StateService Server Sessions Total

 

Correct Answer: B

Explanation/Reference:

“monitor the instancing behaviour” –> ServiceModeService 4.0.0.0Instances

 

 

QUESTION 89

You are developing a Windows Communication Foundation (WCF) service that allows customers to update financial data. The service contract is defined as follows. (Line numbers are included for reference only)

01 [ServiceContract]

02 public interface IDataUpdate

03 {

04 [OperationContract]

05 [TransactionFlow(TransactionFlowOption.Mandatory)]

06 void Update(string accountNumber, double amount);

07 }

08

09 class UpdateService : IDataUpdate

10 {

11 [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = false)]

12 public void Update(string accountNumber, double amount)

13 {

14 …

15 }

16 }

17

You need to ensure that the service is invoked within the transaction. What should you do?

 

A. Replace line 01 with the following code

[ServiceContract(SessionMode = SessionMode.NotAllowed)]

B. Replace line 01 with the following code

[ServiceContract(SessionMode = SessionMode.Required)]

C. Call the Invoke method of the form and supply a delegate.

D. Call the BeginInvoke method of the form and supply a delegate.

 

Correct Answer: B

Explanation/Reference:

The contract for the service defines that all of the operations require a transaction to be flowed with requests:

[ServiceContract(Namespace = “http://Microsoft.ServiceModel.Samples”, SessionMode = SessionMode.Required)] public interface ICalculator {

 [OperationContract]

 [TransactionFlow(TransactionFlowOption.Mandatory)]

 double Add(double n);

 [OperationContract]

 [TransactionFlow(TransactionFlowOption.Mandatory)]

 double Subtract(double n);

 [OperationContract]

 [TransactionFlow(TransactionFlowOption.Mandatory)]

 double Multiply(double n);

 [OperationContract]

 [TransactionFlow(TransactionFlowOption.Mandatory)]

 double Divide(double n);

}

Service Transaction Behavior

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

 

 

QUESTION 90

You are developing a Windows Communication Foundation (WCF) service that is hosted by a Windows Forms Application.

The ServiceHost instance is created in the Form Constructor.

You need to ensure that the service is not blocked while the UI thread is busy. What should you do?

 

A. Decorate the service implementation class with the following line of code

[ServiceBehavior(UseSyncronizationContext = false)]

B. Decorate the service implementation class with the following line of code

[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)]

C. Call the Invoke method of the form and supply a delegate.

D. Call the BeginInvoke method of the form and supply a delegate.

 

Correct Answer: A

Explanation/Reference:ServiceBehaviorAttribute.UseSynchronizationContext Property

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

ServiceBehaviorAttribute.UseSynchronizationContext Property

Gets or sets a value that specifies whether to use the current synchronization context to choose the thread of execution.

Use this property to provide the user interface thread affinity that some applications require.

For example, a Windows Forms application may be registered as a singleton service object.

In this case, all calls into the service must run on the Windows Forms thread.

The default case, in which UseSynchronizationContext is set to true, synchronizes all calls to

the service to run on the thread captured from the System.Threading.SynchronizationContext.

Writing Smart Clients by Using Windows Communication Foundation

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

 

 

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