Microsoft TS: Microsoft .NET Framework 3.5 C Windows Communication Foundation - 070-503 Exam Practice Test

Question 1
You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. The service has an operation contract named GetMessage.
You write the following code segment to implement the service. (Line numbers are included for reference only.)

You need to send the contents of the File.xml file to a client application by using the SOAP body.
Which code segment should you insert at line 08?

Correct Answer: A
Question 2
You create a Windows Communication Foundation (WCF) service by using Microsoft .NET Framework 3.5. You write the following code segment. (Line numbers are included for reference only.)
01 public interface IMyService
02{
04 string ProcessString(string name);
05}
You create a host for the WCF service. You also create a service endpoint at http://localhost:8080/service. You add an instance of the HttpTransferEndPointBehavior class to the host.
You need to ensure that the ProcessString method can be invoked from a Web browser by using the URL http://localhost:8080/service/process? name=value.
Which code segment should you insert at line 03?

Correct Answer: D
Question 3
You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. The service uses the net.tcp transport. You need to ensure that when the server starts, the service starts and continues to run. What should you do?

Correct Answer: B
Question 4
You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. You write the following XML code fragment.

You need to add an endpoint definition to the service configuration for the URL http://localhost:8000/ServiceModelExam/service to expose the Contoso. Exams. lExam service contract. Which definition should you add?

Correct Answer: B
Question 5
You are creating a Windows Communication Foundation (WCF) service by using Microsoft .NET Framework 3.5.
You add the following code segment to the service.

You add the following code segment to the client application.
01 Public Function PerformCalculations(ByVal numberl As Double, _ ByVal number2 As Double) As Double
03 End Function
You need to ensure that the DisposeCalculator operation is always called.
Which code segment should you insert at line 02?

Correct Answer: A
Question 6
You create a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. You write the following code segment.

You need to ensure that when the MyMethod method is called, the service is the root of a transaction.
Which code segment should you insert at line 08?

Correct Answer: D
Question 7
You are creating a Windows Communication Foundation (WCF) service by using Microsoft .NET Framework 3.5.
You need to use a custom service host to host the WCF service in Windows Activation Services (WAS).
What should you do?

Correct Answer: B
Question 8
You are creating a Windows Communication Foundation (WCF) service by using Microsoft .NET Framework 3.5.
You create an instance of the ServerHost class. You plan to host the WCF service in a Windows service.
You need to link the lifetime of the WCF service to the lifetime of the Windows service.
Which three actions should you perform on the instance of the ServerHost class? (Each correct answer presents part of the solution. Choose three.)

Correct Answer: A,B,C