You are on page 1of 29

Chapter - 1 1. IIS means a. Internet Information Services b. Interanet Information Services c. Internet Information Service d.

None of above Answer: A 2. SOA means. a. Service Oriented Architecture b. Service Object Architecture c. Services Oriented Architecture d. Service Orient Architecture Answer: A 3. COM means _________. a. Cascading Object Model b. Component Object Model c. Cascading Orient Model d. None of above Answer: B 4. SOAP means _______________. a. Simple Object Accesor Protocol b. Simple Orient Access Pipline c. Simple Object Access Protocol d. Simple Oriented Access Protocol Answer: C 5. WSDL means _________. a. Web Services Descri Language b. Web Servicing Descri Language

c. Web Service Descriptor Language d. Web Services Description Language Answer: D 6. RIA means. a. Rich Intranet b. Rich Internet c. Rich Internet d. Rich Internet Answer: B

Applications Applications Application Applicaned

7. WSE means. a. Web Servicing Enhan b. Web Servicing Enhancements c. Web Services Enhancements d. Web Servicing Enhancement Answer: C 8. AJAX means. a. Asynchronou JavaScript and XML b. Asynchronous JavaScript and XML c. Asynchrono JavaScript and XML d. Asynchro JavaScript and XML Answer: B 9. MSMQ means ________. a. Microsoft Model Queue b. Microsoft Message Queuering c. Microsoft Message Queue d. Microsoft Messaging Queue Answer: c

10. JSON means ___________. a. JavaScripting Object Notation b. JavaScript Object Notation c. JavaScript Object Notae. d. JavaScript Orient Notation Answer: B 11. WCF means _________. a. Windows Communication Fandamental b. Windows Communication Foundation c. Web Communication Foundation d. Windows Common Foundation Answer: B 12. A host application must perform several tasks, which include. a. Startng and stopping the service b. Listening for requests from a client application and dire c. Sending any responses from the service back to the client application d. None of Above Answer: A,B,C 13. You need to configure a service that will be hosted on the same computer as the client. Which standard binding would be the most efficient to use? a. Basic binding b. TCP binding c. Peer network binding d. Named pipe binding Answer: d

14. You need to configure a service that will replace an existing MSMQ (Microsoft Message Queue) application on a non-WCF computer. Which standard binding should you use? a. Basic binding b. Web service binding c. msmqIntegrationBinding d. netMsmqBinding Answer: c 15. You need to configure a service that will expose its metadata through HTTP-GET. Which of the following properties must be set to enable this? a. HttpGetEnabled b. ServiceMetadataBehavior c. AddServiceEndpoint d. behaviors Answer: a

Chapter 2
16. You know that your service, which uses the wsHttpBinding, will be used to send large messages. You have been told that MTOM is the most efficient encoding method to use for this scenario. Which steps should you take to ensure that your service uses MTOM to encode messages? a. Change the binding to netTcpBinding because this is the only binding that allows for MTOM encoding. b. Change the binding to netNamedPipeBinding because this is the only binding that allows for MTOM encoding. c. Customize the wsHttpBinding by changing the messageEncoding property to Mtom. d. Do nothing because the default encoding method for the wsHttpBinding is already MTOM. Answer: c

17. You have decided to create a custom binding for your service. Which of the following binding elements are required? (Choose all that apply.) a. Transport b. Encoding c. Security d. Reliability Answer: a,b Chapter:3 / Lession:1 18. You need to deploy a service to a Web server. Which version of IIS supports non-HTTP protocols? A. IIS 5.1 B. IIS 6.0 C. IIS 7.0 D. No versions of IIS Ans:C 19. You have decided to use WAS to host your service because you plan on supporting the TCP protocol. The computer you will use to host the service is running Windows Vista. What must you do before you can set up your Web application? A. In Windows Features, you must select the Non-HTTP activation check box for the Windows Activation Services node. B. In Windows Features, you must select the Non-HTTP activation check box for the .NET Framework 3.0 node. C. In Windows Features, you must select the Non-HTTP activation check box for the Internet Information Services node. D. You must add a Service.svc file to your application directory. Ans:B

20. Your service must support MSMQ (Microsoft Message Queue), and you plan on using WAS to host the application. You have already configured WAS to support non-HTTP activation. Which additional steps must be performed to support MSMQ activation? (Choose all that apply.) A. You must create a private queue, using the Message Queuing snapin. B. You must grant read permissions to the NETWORK SERVICE account for the queue you just created. C. You must specify the private queue name in the endpoint declaration. D. You must add an MSMQ element to the web.config file. Ans:A,C Lession:2 21. Which of the following methods can you use to host a WCF service in a managed application? (Choose all that apply.) A. Windows Forms application B. Windows Presentation Foundation UI application C. Console application D. Windows service Ans:A,B,C,D 22. You have designed a WCF service and now you wish to host it by using a Windows service. Besides creating the Windows service application, what must you do to load your new Windows service? A. Add the application to the machine.config file for your server computer. B. Execute the installutil command-line utility to install the service. C. Add the application to the app.config file for your WCF service. D. Do nothing. All you need to do is create the Windows service application. Ans:B

Chapter-04(Lesson-01) 23. Suppose you have the following Service contract and associated Callback contract:C# [ServiceContract()] public interface IRetrieveHandler { [OperationContract(IsOneWay=true)] void HandleFileRetrieved(string fileName, Stream data); } [ServiceContract(CallbackContract=typeof(IRetrieveHandler))] public interface IStorageArchive { [OperationContract(IsOneWay = true)] void RequestFileRetrieve(string fileName); } Suppose further that you want to define a proxy class manually that can be instantiated and used to communicate with this service. Which of the following is the correct definition for the proxy class? A. public class StorageArchiveProxy : ClientBase<IStorageArchive>, IStorageArchive { public StorageArchiveProxy( InstanceContextinstanceContext, Binding binding, EndpointAddressepAddr) : base(instanceContext, binding, epAddr) {

} public StorageArchiveProxy( InstanceContextinstanceContext, string endpointConfigurationName) : base(instanceContext, endpointConfigurationName) { } public void RequestFileRetrieve(string fileName) { this.Channel.RequestFileRetrieve(fileName); } } B. public class StorageArchiveProxy : DuplexClientBase<IStorageArchive>, IStorageArchive { public StorageArchiveProxy( InstanceContextinstanceContext, Binding binding, EndpointAddressepAddr) : base(instanceContext,binding, epAddr) { } public StorageArchiveProxy( InstanceContextinstanceContext, string endpointConfigurationName) : base(instanceContext,endpointConfigurationName) { }

public void RequestFileRetrieve(string fileName) { this.Channel.RequestFileRetrieve(fileName); } } C. public class StorageArchiveProxy : DuplexClientBase<IStorageArchive>, IStorageArchive { public StorageArchiveProxy( Binding binding, EndpointAddressepAddr) : base(binding, epAddr) { } public StorageArchiveProxy( string endpointConfigurationName) : base(endpointConfigurationName) { } public void RequestFileRetrieve(string fileName) { this.Channel.RequestFileRetrieve(fileName); } } D. public class StorageArchiveProxy : ClientBase<IStorageArchive>, IStorageArchive { public StorageArchiveProxy( Binding binding, EndpointAddressepAddr)

: base(binding, epAddr) { } public StorageArchiveProxy( string endpointConfigurationName) : base(endpointConfigurationName) { } public void RequestFileRetrieve(string fileName) { this.Channel.RequestFileRetrieve(fileName); } } Answer : B

24. Suppose you have the following Service contract: [ServiceContract()] public interface IOrderEntryService { [OperationContract()] OrderAcknowledgementSumbitOrder(Order order); // Etc... } Suppose further that you have generated a proxy class for this service that is equipped

with the asynchronous Begin- and End- method pair needed to invoke the SubmitOrder operation asynchronously. Several steps need to be taken to successfully invoke this operation asynchronously and be called back when the operation completes. Which of the following steps to achieve this goal is incorrectly implemented? A. Define a handler method that will be called back when the asynchronously invoked operation completes, such as: static void HandleOrderSubmitted(AsyncCallbackcb) { // Etc... } B. Asynchronously invoke the operation by calling the Begin- method as shown here: OrderEntryServiceClient proxy = new OrderEntryServiceClient(); AsyncCallbackcb = new AsyncCallback(HandleOrderSubmitted); proxy.BeginSumbitOrder(order, cb, proxy); C. Access the proxy object from the AsyncState property when the callback handl has been called: OrderEntryServiceClient proxy = result.AsyncState as OrderEntryServiceClient; D. Having already accessed the proxy object in the callback handler, use it to end th call: OrderAcknowledgementack = proxy.EndSumbitOrder(result);

Answer : A

Chapter -04(Lesson-02) 25. You need to consume a service built in Java. Which of the following are valid methods you can use to create a WCF proxy class to consume this service? Choose all that apply. A. Use the ChannelFactory class to create a proxy object dynamically. B. Use the svcutil command-line tool to generate a proxy class by referencing the WSDL for the service. C. Manually define a proxy class that inherits from ClientBase. D. Add a service reference in Visual Studio by referencing the WSDL for the service. Answer : B,D Chapter 5 Configuring WCF Lesson 1: Configuring the Client Endpoint 26. Consider the following segment from a configuration file. <system.serviceModel> <client> <endpoint address="http://localhost:8080/UpdateService" binding="basicHttpBinding" bindingConfiguration="NameOfBinding"

contract="IUpdateService" /> </client> <bindings> <basicHttpBinding> <binding name="NameOfBinding" receiveTimeout="00:01:00" sendTimeout="00:00:10" openTimeout="00:05:00" closeTimeout="00:20:00" /> </basicHttpBinding> </bindings> </system.serviceModel> Which of the following statements are true? (Choose all that apply.) A. The service found at http://localhost:8080/UpdateService could be an ASMX Web service. B. The service found at http://localhost:8080/UpdateService could be a WCF service that uses only named pipes. C. The service found at http://localhost:8080/UpdateService supports only the methods found in the IUpdateService interface. D. If the service found at http://localhost:8080/UpdateService doesnt return a response within one minute, an exception is raised. E. If the service found at http://localhost:8080/UpdateService doesnt return a response within ten seconds, an exception is raised. Answers: A, E

27. Consider the following segment from a configuration file. <system.serviceModel> <client> <endpoint address="net.tcp://localhost:8888/UpdateService" binding="netTcpBinding" contract="IUpdateService" name="UpdateEndpoint" behaviorConfiguration="DefaultBehavior"/> </client> <bindings> <basicHttpBinding> <binding name="BasicTimeout" openTimeout="00:10:00" /> </basicHttpBinding> <netTcpBinding> <binding name="DefaultBinding" openTimeout="00:05:00" /> <binding name="TcpTimeout" openTimeout="00:20:00" /> </netTcpBinding> </bindings> <behaviors> <endpointBehaviors> <behavior name="UpdateClient"> <clientCredentials> <windows allowedImpersonationLevel="Identification" /> </clientCredentials> </behavior> </endpointBehaviors> </behaviors> </system.serviceModel> Which of the following statements are true? (Choose all that apply.)

A. When a call is made to the service, the connection will remain open for five minutes. B. When a call is made to the service, the connection will remain open for one minute. C. When a call is made to the service, the connection will remain open for 10 minutes. D. When a call is made to the service, the service will process the request as the default user for that service. E. When a call is made to the service, the service will process the request, using the credentials of the user who is running the client. Answers: B, D 28. Consider the following segment from a configuration file for a WCF service. <system.serviceModel> <services> <service name="UpdateService" > <endpoint address="net.pipe://localhost/UpdateService" contract="IUpdateService" binding="netNamedPipeBinding" /> </service> </services> </system.serviceModel> Which of the following code segments would be used to configure the client-side proxy? A. NetNamedPipeBinding binding = new NetNamedPipeBinding();

EndpointAddressep = new EndpointAddress("net.pipe://localhost/UpdateService"); UpdateServiceProxy proxy = new UpdateServiceProxy(binding, ep); Lesson 1: Configuring the Client Endpoint 223 B. WsHttpBinding binding = new WsHttpBinding(); EndpointAddressep = new EndpointAddress("http://localhost/UpdateService"); UpdateServiceProxy proxy = new UpdateServiceProxy(binding, ep); C. NetNamedPipeBinding binding = new NetNamedPipeBinding(); EndpointAddressep = new EndpointAddress("http://localhost/UpdateService"); UpdateServiceProxy proxy = new UpdateServiceProxy(binding, ep); D. BasicHttpBinding binding = new BasicHttpBinding(); EndpointAddressep = new EndpointAddress("net.pipe://localhost/UpdateService"); UpdateServiceProxy proxy = new UpdateServiceProxy(binding, ep); Answer: A

Lesson 2: Dynamic Service Configuration 29. You have created a client application that needs the WCF service to invoke a callback method. Which of the following bindings supports this requirement? A. B. C. D. basicHttpBinding wsHttpBinding wsHttpContextBinding wsDualHttpBinding

Answer: D

30. You have created a client application that needs the WCF service to invoke a callback method. Which of the following bindings does not support this requirement? A. B. C. D. netTcpBinding netNamedPipeBinding netMsmqBinding netTcpContextBinding

Answer: C 31. Consider the following element from a configuration file: <system.serviceModel> <diagnostics> <messageLogging logEntireMessage="true" logMalformedMessages="false" logMessageAtServiceLevel="true" maxMessagesToLog="1000" maxSizeOfMessageToLog="2000"/> </diagnostics> </system.serviceModel> What is the maximum number of WCF message that will appear in the trace log? A. 1,000 B. 1,001 C. 2,000 D. No limit. Answer: B

32. One of your developers has created a WCF application. She believes that she has configured the client portion of the application to capture tracing information. However, when the application runs, only some of the expected information appears in the log file. It appears that the last few log entries are missing. Which of the following is likely to be the cause of the problem? A. A listener has not been defined for the source of the tracing information. B. A source has not been defined for the tracing information. C. The logEntireMessage attribute of the messageLogging element is set to false. D. The autoflush property of the trace element has not been set to true. Answer: D 33. You have created a WCF application. You would like to implement end-to-end tracing. You believe you have done so, but when you look at the Service Trace Viewer, the client and service traces do not appear to be correlated. Moreover, when you check the Trace.CorrelationManager.ActivityId property in the service, it is not the same as in the client. Which of the following is NOT a potential solution to this problem? A. The switchValue attribute for the System.ServiceModel source is not set to ActivityTracing.

B. In the client side, the Trace.CorrelationManager.ActivityId has not been assigned a new GUID value. C. The propagateActivity attribute in the System.ServiceModel source has not been set to true. D. A Transfer trace has not been emitted on the client. Answer: D 34. You are designing an activity to correlate functionality across multiple clients and services. Specifically, a client sends a request to a service, which then sends a request to a different service. This last service is not in your control, so you dont want the trace information generated by the service to be included in your activity. Which of the following methods should be called immediately prior to invoking the thirdparty service? A. Trace.TraceEvent(TraceEvent.Start, 0, B. Trace.TraceEvent(TraceEvent.Stop, 0, C. Trace.TraceEvent(TraceEvent.Suspend, D. Trace.TraceEvent(TraceEvent.Transfer, Answer: C My Activity) My Activity) 0, My Activity) 0, My Activity)

35. On the service side for a WCF application, which of the following extension points must have some extension functionality implemented also on the client side? A. Message Inspection B. Message Formatting

C. Parameter Inspection D. Operation Invoker Answer: B 36. In a Message object, the MessageState property is set to Written. Which of the following must have already occurred? A. The GetReaderAtBodyContents method has been called. B. The WriteBodyContents method has been called. C. The CreateBufferedCopy method has been called. D. The CreateMessage method has been called. Answer: B 37. Which of the following statements is true when discussing the use of Performance Counters in a WCF application? A. The default setting for WCF performance counters is to not update any performance counters. B. The performance counters can be captured even when the WCF service is not running. C. If the service exposes the same endpoint address and contract across multiple bindings, the performance counter information is maintained separately. D. The performance counters associated with the client side of a WCF application can be captured only while the client application is running. Answer: A 38. You have created a WCF service. You would like to integrate health monitoring of this

service with WMI. You think you have configured the service appropriately, but messages from your service do not appear to be posted into WMI. Which of the following could NOT be a potential cause of the problem? A. You are running the WCF service in the Local Service security context. B. You have not added a registry entry named wmiProviderEnabled to the HKLM \System\CurrentControlSet\Services\ServiceModelService 3.0.0.0\Performance registry key. C. The wmiProviderEnabled attribute in the diagnostics element in system.serviceModel is set to true. D. The application processing the WMI events is running on a remote computer. Answer: A Chapter 7 39. Which of the following statements about transport-level security are NOT true? A. Transport-level security encrypts the entire message, even the header information. B. Transport-level security supports only the security mechanisms that the underlying binding is capable of using. C. Every WCF binding can be configured to use or not use transportlevel security as required.

D. Transport-level security ensures that the message cannot be modified while in transit between the client and the service. Answer: C 40. Which of the following bindings does NOT transport-level security? A. basicHttpBinding B. netTcpBinding C. wsDualHttpBinding D. netNamedPipeBinding Answer: C provide any support for

41. Which of the following bindings requires the presence of AD DS to provide transportlevel security for a WCF application when the client and service are on different computers? A. wsHttpBinding B. netNamedPipeBinding C. netTcpBinding D. msmqIntegrationBindin Answer: D

42. Which of the following statements about WCF message-level security is NOT true? A. Message-level security does not depend on the capabilities of the underlying protocol. B. Message-level security allows for the ability to secure only a portion of the message.

C. All the built-in bindings support Windows authentication as a means for securing messages. D. The authentication method used to secure messages can be specified through the configuration file. Answer: C 43. You have a WCF application. When deployed, the client and service will be installed on different computers. The <binding> element for the application looks like the following: <binding name="myBinding"> <security mode="Message"/> <message clientCredentialType="Windows" negotiateServiceCredentials="true"/> </binding> When the application is executed, an exception is thrown, indicating that the client cannot be authenticated. Which of the following is a potential cause for the problem? A. The client computer and the service computer are not in the same domain. B. The client computer and the service computer are in the same domain. C. The establishSecurityContext attribute should be added and given a value of true. D. A client-side certificate needs to be created and associated with the services credentials. Answer: A

Chapter08(Lesson 01) 44. You have created a WCF application that is using basicHttpBinding. You would like to enable the client to log on to the service without needing to provide a user ID and pass-word every time. Which of the following authentication mechanisms should you choose? A. Certificate B. UserName C. Windows D. IssuedToken Answer: A

45. You have created a WCF application that is intended to use custom authentication. The configuration file contains the following relevant sections. <bindings> <wsHttpBinding> <binding name="QuestionBinding" > 382 Chapter 8 User-Level Security <security mode="TransportWithMessageCredential"> <transport clientCredentialType="Certificate"/> <message clientCredentialType="Certificate" /> </security> </binding> </wsHttpBinding> </bindings> <behaviors> <endpointBehaviors> <behavior name="QuestionBehavior">

<clientCredentials> <clientCertificatefindValue="localhost" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" /> </clientCredentials> </behavior> </endpointBehaviors> </behaviors> The endpoint used by the WCF application references both the QuestionBinding binding and the QuestionBehavor behavior. When the application is executed, a MessageSecurity-Exception is raised, with the inner exception indicating that an error occurred while ver-ifying security for the message. Which of the following changes will correct the problem? A. Change the x509FindType attribute in the clientCertificate element to FindByDistin-guishedSubjectName. B. Change the clientCertificateType attribute in the transport element to UserName. C. Change the clientCertificateType attribute in the message element to UserName. D. Change the findValue attribute in the clientCertificate element to CN=localhost Answer: C Chapter08(Lesson 02) 46. Regarding the WCF authorization process, which of the following statements is true? A. Access to methods cannot be restricted based on the username of the requester, using declarative techniques.

B. For WCF authorization to occur, the clients configuration file must be modified specifically to support it. C. Additional claims on which authorization is based cannot be injected into the WCF pipeline while a request is being processed. D. A WCF application can use a custom token to maintain a security context over mul-tiple requests between the same client and service. Answer: A 47. You have created a WCF application that uses Windows authentication to verify the identity of the requester. The service is being hosted in a Windows service that needs to access a file that is local to the computer on which the service is running. The identity under which the service is running does not have access to the file, but the requester does. Which is the minimum impersonation level that should be used? A. Anonymous B. Identification C. Impersonation D. Delegation Answer: C 48. You have created a WCF application that uses Windows authentication to verify the identity of the requester. The service is being hosted in a Windows service that needs to access a file through a Universal Naming Convention (UNC) path. The identity under

which the service is running does not have access to the file, but the requester does. Which is the minimum impersonation level that should be used? A. Anonymous B. Identification C. Impersonation D. Delegation Answer: D Chapter - 9 49. You would like to create a WCF service that is capable of processing any message that arrives at an endpoint. Which one of the following statements is true? A. The Action property of the OperationContract attribute that decorates the method must be set to *. B. The Action property of the OperationContract attribute that decorates the method must be set to the namespace for the WCF services exposed interface. C. The ReplyAction property of the OperationContract attribute that decorates the method must be set to *. D. The ReplyAction property of the OperationContract attribute that decorates the method must be set to the namespace for the WCF services exposed interface. Answer: A

50. The State property of a Message object indicates the status of the message body. To retrieve the contents of the message, the generic GetBody function is used. What state must the Message object be in so that GetBody does not throw an exception? A. Created. B. Read. C. Copied. D. Written. E. Closed. Answer: C 51. Consider a class that is expected to be used as a typed fault for a WCF operation. Which one of the following statements is true? A. The class must derive from the System.Exception class. B. The class must be serializable. C. The class must be implemented in a dynamic-link library (DLL) library that is shared by both the client and the service. D. All the properties in the class must be initialized as part of the constructor. Answer: C 52. Consider the following code from a WCF client application. try { FaultServiceClient proxy = new FaultServiceClient(); Console.WriteLine(proxy.Hello("World")); } catch (FaultException<DemoFault> de) { Console.WriteLine("DemoFault returned");

} catch (FaultExceptionfe) { Console.WriteLine("FaultException returned"); } catch (CommunicationExceptionce) { Console.WriteLine("CommunicationsException returned"); } In the service class, the following code is executed:

throw new ApplicationException("Bad stuff happened"); Which of the following would appear in the Console window? A. Hello World. B. DemoFault returned. C. FaultException returned. D. CommunicationException returned. Answer: D