Microsoft TS: Microsoft .NET Framework 3.5 C Windows Communication Foundation (070-503) Free Practice Test
Question 1
You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. You write the following code segment. (Line numbers are included for reference only.)

When you browse to the base address of the service, you receive the following message:
"Metadata publishing for this service is currently disabled."
You debug the code and discover that the ServiceMetadataBehavior behavior was previously nonexistent.
You need to enable metadata publishing.
What should you do?

When you browse to the base address of the service, you receive the following message:
"Metadata publishing for this service is currently disabled."
You debug the code and discover that the ServiceMetadataBehavior behavior was previously nonexistent.
You need to enable metadata publishing.
What should you do?
Correct Answer: D
Question 2
You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.
You add the following code fragment to the app.config file for the service.

You need to enable personal identifiable information (PII) logging for the second trace source.
What should you do?
You add the following code fragment to the app.config file for the service.

You need to enable personal identifiable information (PII) logging for the second trace source.
What should you do?
Correct Answer: C
Question 3
You create a client application by using Microsoft .NET Framework 3.5. The client application uses a Windows Communication Foundation (WCF) service.
The WCF service analyzes incoming message headers to verify whether special processing of the message is required.
The client application accompanies each call to the methods of the service with the address header.
You write the following code segment. (Line numbers are included for reference only.)

You need to ensure that the following requirements are met:
The client application makes a second call to the FindPhoneByAddress method.
The message header of the second call is presented by a variable named newHeader.
Which code segment should you insert at line 11?

The WCF service analyzes incoming message headers to verify whether special processing of the message is required.
The client application accompanies each call to the methods of the service with the address header.
You write the following code segment. (Line numbers are included for reference only.)

You need to ensure that the following requirements are met:
The client application makes a second call to the FindPhoneByAddress method.
The message header of the second call is presented by a variable named newHeader.
Which code segment should you insert at line 11?

Correct Answer: B
Question 4
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?
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 5
You create a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. You write the following code segment.

You have not deployed the IMathService service.
You need to expose the AddNumbers (double a, double b) operation to the IMathService
service contract.
Which code segment should you use?


You have not deployed the IMathService service.
You need to expose the AddNumbers (double a, double b) operation to the IMathService
service contract.
Which code segment should you use?

Correct Answer: B
Question 6
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?
What should you do?
Correct Answer: A
Question 7
You are creating a Windows Communication Foundation (WCF) client application by using Microsoft .NET Framework 3.5.
The WCF application is hosted in a Windows service. The service uses the LocalSystem account. The application uses Message Security with Windows credentials.
You need to ensure that the application does not negotiate the authentication protocol.
Which endpoint identity settings should you apply?
The WCF application is hosted in a Windows service. The service uses the LocalSystem account. The application uses Message Security with Windows credentials.
You need to ensure that the application does not negotiate the authentication protocol.
Which endpoint identity settings should you apply?
Correct Answer: B
Question 8
You create a Windows Communication Foundation (WCF) application by using Microsoft Visual Studio 2008 and the .NET Framework 3.5. You create a WCF service by using the following code segment. (Line numbers are included for reference only.)
01 [ServiceContract]
02 public interface IContosoService
03 {
04 [OperationContract]
06 void ProcessTransaction();
07 }
09 public class ContosoService : IContosoService
10 {
11 public void ProcessTransaction() {
12 try {
13 BusinessComponent.ProcessTransaction();
14 }
15 catch (ApplicationException appEx) {
17 }
18 }
19 }
The BusinessComponent.ProcessTransaction method will only throw exceptions from the ApplicationException type. You plan to debug the WCF service. You need to ensure that the WCF service meets the following requirements:
Detailed exception information is provided to the client application. Subsequent calls can be issued to the service by using the same proxy intance after an exception is caught in the client application. What should you do?
01 [ServiceContract]
02 public interface IContosoService
03 {
04 [OperationContract]
06 void ProcessTransaction();
07 }
09 public class ContosoService : IContosoService
10 {
11 public void ProcessTransaction() {
12 try {
13 BusinessComponent.ProcessTransaction();
14 }
15 catch (ApplicationException appEx) {
17 }
18 }
19 }
The BusinessComponent.ProcessTransaction method will only throw exceptions from the ApplicationException type. You plan to debug the WCF service. You need to ensure that the WCF service meets the following requirements:
Detailed exception information is provided to the client application. Subsequent calls can be issued to the service by using the same proxy intance after an exception is caught in the client application. What should you do?
Correct Answer: A
Question 9
You are creating a distributed client application by using Microsoft .NET Framework 3.5. You use Windows Communication Foundation (WCF) to create the application. You specify the following configuration settings for the service application.

You need to authenticate the client application by using the Microsoft ASP.NET membership provider.
Which configuration settings should you use?


You need to authenticate the client application by using the Microsoft ASP.NET membership provider.
Which configuration settings should you use?

Correct Answer: C
Question 10
You are replacing an ASMX Web service with a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.
The ASMX Web service has a number of existing clients, which you cannot recompile and redeploy. You need to maintain backward compatibility with the existing clients.
Which code fragment should you use?

The ASMX Web service has a number of existing clients, which you cannot recompile and redeploy. You need to maintain backward compatibility with the existing clients.
Which code fragment should you use?

Correct Answer: E
Question 11
You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.
You add the following code fragment to the app.config file for the service.

You need to enable personal identifiable information (PII) logging for the second trace source.
What should you do?
You add the following code fragment to the app.config file for the service.

You need to enable personal identifiable information (PII) logging for the second trace source.
What should you do?
Correct Answer: C
Question 12
You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.
You write the following code segment to implement an operation contract. (Line numbers are included for reference only.)

Only the contents of the File.xml file are sent to the client application.
You need to ensure that the SOAP envelope generation is always disabled for messages that are sent to the client application.
Which line of code should you insert at line 04?
You write the following code segment to implement an operation contract. (Line numbers are included for reference only.)

Only the contents of the File.xml file are sent to the client application.
You need to ensure that the SOAP envelope generation is always disabled for messages that are sent to the client application.
Which line of code should you insert at line 04?
Correct Answer: C