Which code segment should you add?
You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. You have successfully defined a service contract named IManageOrders. You write the following code segment.
public class OrderImpl : IManageOrders {
public void MarkOrderClosed(int orderId){
try {
…
}
catch (SqlException exc){
throw new FaultException<DataFault>(new DataFault()); }}}
[DataContract]
public class DataFault {
}
You need to create a fault contract for the MarkOrderClosed method on the IManageOrders service contract. Which code segment should you add?
What should you do?
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?
Which code segment should you use?
You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. The service will be hosted in a Windows Service environment. You need to create a Windows Service class that instantiates a service host. Which code segment should you use?
Which code fragment should you use?
You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. The service will be hosted in a managed Console application. You want to add endpoints to the service. You need to ensure that all endpoints use the same base address.
Which code fragment should you use?
Which utility should you use?
You are creating a Windows Communication Foundation (WCF) service by using Microsoft .NET Framework 3.5.
The service will be hosted on a Web server.
You plan to deploy the service in an existing Web application.
You need to identify the Web applications on the Web server that are registered for WCF.
Which utility should you use?
Which code segment should you use?
You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.
You need to programmatically add the following endpoint definition to the service. http://localhost:8000/ExamService/service
Which code segment should you use?
Which two bindings should you use?
You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.
You need to host the service in a medium trust environment on a Web server.
Which two bindings should you use?
(Each correct answer presents a complete solution. Choose two.)
What should you do?
You create an application by using Microsoft Visual Studio .NET 2008 and the .NET Framework 3.5. The application connects to a Microsoft SQL Server 2005 database by using LINQ to SQL. The database contains a table named MarketTransaction. The MarketTransaction records must be validated against certain business rules before they are added to or updated in the database. You need to design a validation strategy for the MarketTransaction records. You also need to ensure that the schema changes do not affect the validation code. What should you do?
02 new Uri (?http://localhost:8000/ExamService?
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.)
01 Uri baseAddress=
02 new Uri (?http://localhost:8000/ExamService?);
03 Uri mexAddress=new Uri(“”);
04 ServiceHost serviceHost=new ServiceHost(typeof( 05 ExamService), baseAddress);
06 ServiceMetadataBehavior smb=
07 serviceHost.Description.Behaviors.
08 Find<ServiceMetadataBehavior>();
09 if (smb != null)
10 {
12 }
13 else
14 {
15 smb=new ServiceMetadataBehavior();
16 serviceHost.Description.Behaviors.Add(smb);
17 }
18 smb.HttpGetUrl=mexAddress;
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?
Which code segment should you use?
You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.
You find that the service starts even though the endpoints have not been configured correctly.
You need to create a custom service behavior that throws an exception if the list of endpoints that are configured is not complete.
Which code segment should you use?