0% found this document useful (0 votes)
21 views19 pages

TS: Windows Communication Foundation Development: Version: Demo

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 19

70-513

TS: Windows Communication Foundation Development


with Microsoft .NET Framework 4
Version: Demo

Your Partner of IT Exam visit - http://www.exambible.com


About Exambible

Your Partner of IT Exam

Found in 1998

Exambible is a company specialized on providing high quality IT exam practice study


materials, especially Cisco CCNA, CCDA, CCNP, CCIE, Checkpoint CCSE, CompTIA
A+, Network+ certification practice exams and so on. We guarantee that the candidates
will not only pass any IT exam at the first attempt but also get profound understanding
about the certificates they have got. There are so many alike companies in this industry,
however, Exambible has its unique advantages that other companies could not achieve.

Our Advances

* 99.9% Uptime
All examinations will be up to date.
* 24/7 Quality Support
We will provide service round the clock.
* 100% Pass Rate
Our guarantee that you will pass the exam.
* Unique Gurantee
If you do not pass the exam at the first time, we will not only arrange FULL
REFUND for you, but also provide you another exam of your claim,
ABSOLUTELY FREE!

Your Partner of IT Exam visit - http://www.exambible.com


1. You develop a Windows Communication Foundation (WCF) service. It is used exclusively as an intranet
application and is currently unsecured.

You need to ensure that the service meets the following requirements:

? The service now must be exposed as an Internet application.

? The service must be secured at the transport level.

? Impersonation and delegation cannot be enabled.

What should you use?

A. wsHttpBinding and HTTPS

B. basicHttpBinding and Kerberos

C. basicHttpBinding and HTTP

D. wsHttpBinding and Kerberos

Answer: A

2. An existing Windows Communication Foundation (WCF) service uses basicHttpBinding. You are releasing
updates to the service and the client application.

You need to enable the client application to flow transactions to the service.

What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose
two.)

A. Change to a custom binding that has the httpTransport, textMessageEndcoding, and transactionFlow
binding elements in this order.

B. Change to a custom binding that has the transactionFlow, textMessageEncoding, and httpTransport
binding elements in this order.

C. Change the binding to use wsHttpBinding.

D. Change the binding to use basicHttpContextBinding.

Answer: B,C

3. You are developing a Windows Communication Foundation (WCF) service that allows customers to update
financial data.

The client applications call the service in a transaction. The service contract is defined as follows. (Line
numbers are included for reference only.)

Your Partner of IT Exam visit - http://www.exambible.com


Customers report that the transaction completes successfully even if the Update method throws an exception.

You need to ensure that the transaction is aborted if the Update method is not successful. What should you
do?

A. insert the following line at line 22. throw;

B. Insert the following line at line 09. [ServiceBehavior( TransactionAutoCompleteOnSessionClose = false)]

C. Replace line 12 with the following line. [OperationBehavior( TransactionScopeRequired = true,


TransactionAutoCoroplete - false)]

D. Insert the following line at line 09. [ServiceBehavior( TransactionAutoCompleteOnSessionClose = true)]

Answer:: A

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

You must record all available information for the first 1,000 messages processed, even if they are malformed.

Your Partner of IT Exam visit - http://www.exambible.com


You need to configure the message logging section of the configuration file. Which configuration segment
should you use?

A. <messageLogging logEntireMessage="true" logMalformedMessages="true"


logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" maxMessagesToLog="1000"/>

B. <messageLogging logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true"


maxMessagesToLog="1000"/>

C. <messageLogging logEntireMessage="false" logMessagesAtServiceLevel="true"


logMessagesAtTransportLevel="false" maxMessagesToLog="1000"/>

D. <messageLogging logMalformedMessages="true" logMessagesAtServiceLevel="true"


logMessagesAtTransportLevel="false" maxMessagesToLog="1000"/>

Answer: A

5. You are developing a Windows Communication Foundation (WCF) service to replace an existing A5MX
Web service.

The WCF service contains the following code segment. (Line numbers are included for reference only.)

The existing Web service returns the EmployeeID as an attribute of the EmployeeInfo element in the
response XML.

You need to ensure that applications can consume the service without code changes in the client.

Your Partner of IT Exam visit - http://www.exambible.com


A. Option A

B. Option B

C. Option C

D. Option D

Answer: C

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

the following service contract.

[ServiceContract]

public interface IOrderProcessing

Your Partner of IT Exam visit - http://www.exambible.com


[OperationContract]

void ApproveOrder(int id);

You need to ensure that only users with the Manager role can call the ApproveOrder method.

What should you do?

A. In the method body, check the Rights.PossessProperty property to see if it contains Manager.

B. Add a PrincipalPermission attribute to the method and set the Roles property to Manager.

C. Add a SecurityPermission attribute to the method and set the SecurityAction to Demand.

D. In the method body, create a new instance of WindowsClaimSet. Use the FindClaims method to locate a
claimType named Role with a right named Manager.

Answer: B

7. DRAG DROP

You configure a Windows Communication Foundation (WCF) service. The service has a class named Person
that includes the following code segment:

The Person class has the following requirements:

? The secret property must be encrypted and serialized in the SOAP header.

? The comments property must be transmitted in plain text and serialized in the SOAP body.

? The name property must be transmitted in plain text and serialized in the SOAP body.

? The service must ensure the integrity of the name property when data is transmitted.

? The service must not ensure the integrity of the comments property when data is transmitted.

You need to ensure that the Person class is serialized.

How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct
location or locations in the answer area. Each code segment may be used once, more than once, or not at all.
You may need to drag the split bar between panes or scroll to view content.)

Your Partner of IT Exam visit - http://www.exambible.com


Answer:

8. You develop a Windows Communication Foundation (WCF) service to generate reports. Client applications
call the service to initiate report generation but do not wait for the reports to be generated. The service does
not provide any status to the client applications.

The service class is defined as follows. (Line numbers are included for reference only.)

You need to ensure that client applications can initiate reports without waiting for status. Which two actions

Your Partner of IT Exam visit - http://www.exambible.com


should you perform (Each correct answer presents part of the solution.

Choose two.)

A. Insert the following code at line 04. [OperationContract(IsOneWay=true)]

B. Insert the following code at line 04. [OperationContract(AsyncPattern=false)]

C. At line 05, change the GenerateReports method from private to public.

D. Remove line 08. At line 05, change the return type of GenerateReports method to void.

Answer: A,D

9. 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");r

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


svcHostAddServiceEndpoint(typeof(lHelloService),

Your Partner of IT Exam visit - http://www.exambible.com


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;

Answer: A

10. 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 not routed between intermediaries.

The WCF binding you are using by default does not support encryption.

You need to ensure that fingerprint data is not disclosed when it is passed over the network.

What should you do?

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

B. Use basicHttpBinding over transport security at https://www.contoso.com.

C. Use wsHttpBinding over message security at https://www.contoso.com.

D. Use wsHttpBinding over transport security at http://www.contoso.com.

Answer: B

11. You develop a Windows Communication Foundation (WCF) service that is hosted by using Windows
Activation Services (WAS).

You need to configure the service to accept requests that use the TCP/IP protocol. What should you do?
(Each correct answer presents part of the solution. Choose two.)

A. Run the aspnet_regiis executable to enable TCP/IP service activation.

B. In Control Panel, enable the Windows Communication Foundation HTTP Activation feature.

C. In Control Panel, enable the WCF Non-HTTP Activation feature.

Your Partner of IT Exam visit - http://www.exambible.com


D. Run the appcmd executable to enable TCP/IP service activation.

Answer: B,D

Explanation: B: Go to the Control Panel–> Program and Features and select Turn Windows features on or off.
Then you need to select some options/components to install. Have a look at the picture below to see what
those options are

D: Example:

Now we need to enable those protocols on the CalculatorServiceSite website that hosts our WCF service.In
the same Visual Studio 2010 command prompt window type

appcmd.exe set app “Default Web Site/CalculatorServiceSite“

/enabledProtocols:http,net.pipe,net.tcp,net.msmq

Your Partner of IT Exam visit - http://www.exambible.com


Now we have enabled those protocols for our site.Now we are ready to expose endpoints over alternate
protocols e.g TCP,MSMQ. In this way we can have our WCF Service hosted in IIS and still consume it over
the network with clients that support/understand the TCP/IP protocol.

Note:

Windows Process Activation Service generalizes the Internet Information Services (IIS) process model,
removing the dependency on HTTP. All the features of IIS that were previously available only to HTTP
applications are now available to applications hosting Windows Communication Foundation (WCF) services,
by using non-HTTP protocols. IIS 7.0 also uses Windows Process Activation Service for message-based
activation over HTTP.

12. You develop a Windows Communication Foundation (WCF) service.

You name the service MovieService in the Movie namespace. The service is hosted in Microsoft Internet
Information Services (IIS).

You copy the assembly containing the service to the bin folder in the virtual directory path. You need to set up
the URI that is mapped to the service.

What should you do?

A. Add the following code segment to the web.config file.

<serviceHostingEnvironment>

<serviceActivations>

odd relativeAddress="./Movie" service="Movie.MovieService"/>

</serviceAct ivations>

</serviceHostingEnvironment>

B. Add a Movie.svc file in the root of the virtual path with the following line.

<%8ServiceHost language="C#" Service="MovieService"*>

C. Add the following code segment to the web.config file.

<serviceHostingEnvironment>

<serviceActivations>

odd relativeAddress=" . /Movie, svc" service="Hovie.MovieService"/>

</serviceActivations>

</serviceHostingEnvirorunent>

D. Add a Movie.svc file in the root of the virtual path with the following line.

Your Partner of IT Exam visit - http://www.exambible.com


<%8ServiceHost language="C#" Service="MovieService.svc"%>

Answer: B

13. A service implements the following contract. (Line numbers are included for reference only.)

ContosoService uses NetMsmqBinding to listen for messages. The queue was set up to use transactions for
adding and removing messages.

You need to ensure that OperationOne and OperationTwo execute under the same transaction context when
they are invoked in the same session.

What should you do?

A. Insert the following attribute to OperationOne on IContosoService.


[TransactionFlow(TransactionFlowOption.Mandatory)]

Insert the following attribute to OperationTwo on IContosoService.


[TransactionFlow(TransactionFlowOption.Mandatory)]

B. Insert the following attribute to OperationOne on ContosoService.

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

Insert the following attribute to OperationTwo on ContosoService.


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

C. Add the following XML segment to the application config file in the system.serviceModel/bindings
configuration section.

<netMsmqBinding>

Your Partner of IT Exam visit - http://www.exambible.com


<binding name="contosoTx" durable="true" receiveContextEnabled="true" />

</netMsmqBinding>

Then use the NetMsmqBinding named contosoTx to listen for messages from the clients.

D. Add the following XML segment to the application config file in the system.serviceModel/bindings
configuration section.

<customBinding>

<binding name="contosoTx">

<transactionFlow />

<binaryMessageEncoding />

<msmqTransport durable="true" />

</binding>

</customBinding>

Then use the CustomBinding named contosoTx to listen for messages from the clients.

Answer: B

14. You are developing a Windows Communication Foundation (WCF) service. The following code defines
and implements the service. (Line numbers are included for reference only.)

You need to ensure that two identical copies of the received message are created in the service.

Your Partner of IT Exam visit - http://www.exambible.com


Which code segment should you insert at line 12?

A. Message msgCopy = message. CreateBufferedCopy(8192) as Message; Message returnMsg = message.


CreateBufferedCopy(8192) as Message;

B. MessageBuffer buffer = message. CreateBufferedCopy(8192);

Message msgCopy = buffer.CreateMessage(); Message returnMsg = buffer.CreateMessage();

C. MessageBuffer buffer = message. CreateBufferedCopy(8192);

Message msgCopy = buffer.CreateMessage(); Message returnMsg = msgCopy;

D. Message msgCopy = message; Message returnMsg = message;

Answer: B

15. You develop a Windows Communication Foundation (WCF) service that interacts with Microsoft Message
Queuing (MSMQ).

The service requires sessions. You need to create a custom binding that enables messages sent to the
queue to be viewed when you are using a listener tool.

Which binding elements should you use?

A. textMessageEncoding and msmqTransport in this order

B. textMessageEncoding and msmqIntegrationTransport in this order

C. msmqTransport and textMessageEncoding in this order

D. msmqIntegrationTransport and textMessageEncoding in this order

Answer: A

16. 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?

Your Partner of IT Exam visit - http://www.exambible.com


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)]

Answer: A

17. You are modifying a Windows Communication Foundation (WCF) service that provides access to report
generation system. The following code segment is part of your service

contract. (Line numbers are included for reference only.)

Client applications are blocked while the service processes reports. You need to ensure that the service
methods are asynchronous. What should you do?

A. Insert the following code at line 04. [OperationContract]

Insert the following code at line 07. [OperationConcracc(AsyncPactern = true)]

B. Insert the following code at line 04. [OperationConcracc(AayncPaccern = true)]

C. Insert the following code at line 04. [OperotionConcroct(AsyncPactern = false) Insert the following code at
line 07. [OperacionConcracc(AsyncPactern = true)]

D. Insert the following code at line 04. [OperationContract (AsyncPattern = false)]

Answer: B

18. You implement a Windows Communication Foundation (WCF) service.

Your Partner of IT Exam visit - http://www.exambible.com


You must process all of the valid SOAP messages that the service receives. What should you do?

A. On the OperationContractAttribute, call the Match method.

B. Call the Message.CreateMessage static method. Pass the value MessageVersion.Default as a parameter.

C. On the OperationContractAttribute of a method, set the value of the Action and ReplyAction properties to *.

D. On the OperationContractAttribute of a method, set the value of the Action and ReplyAction properties to ?.

Answer: A

19. You develop a Windows Communication Foundation (WCF) RESTful service that provides media
streaming services. The service includes the following code. (Line numbers are included for reference only.)

The service must return an XML response.

You need to apply the correct attribute to AddMediaTitle method. Which code segment should you insert at
line 05?

A. [WebInvolce(ResponseFormat = WebMessageFormat.Xml, BodyStyle =


WebMessageBodyStyle.Wrapped)]

B. [WebInvoice (ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle .Bare) ]

C. [WebInvolce (Method= “POST”) ]

D. [WebInvoice]

Answer: A

20. You have a Windows Communication Foundation (WCF) service that uses a multicast

protocol as a custom transport. The service implements the channel framework. You need to choose a
message exchange pattern for the transport.

What should you use?

A. Datagram by using the IOutputChannel interface for clients and the IInputChannel interface for the service.

B. Half-Duplex by using the IRequestChannel interface for clients and the IReplyChannel interface for the
service.

Your Partner of IT Exam visit - http://www.exambible.com


C. Duplex by using the IDuplexChannel interface for both clients and the service.

D. Request-Response by using the IRequestChannel interface for clients and the IReplyChannel interface for
the service.

Answer: A

Your Partner of IT Exam visit - http://www.exambible.com


Relate Links

100% Pass Your 70-513 Exam with Exambible Prep Materials

http://www.exambible.com/70-513-exam/

Contact us

We are proud of our high-quality customer service, which serves you around the clock 24/7.

Viste - http://www.exambible.com/

Your Partner of IT Exam visit - http://www.exambible.com

Powered by TCPDF (www.tcpdf.org)

You might also like