최신 070-513 무료덤프 - Microsoft TS: Windows Communication Foundation velopment with Microsoft .NET Framework 4
You have a Windows Communication Foundation (WCF) service that accepts the following message contract.

You need to ensure that the client sends a SOAP body that is accepted by the service.

You need to ensure that the client sends a SOAP body that is accepted by the service.
정답: A
You are developing a Windows Communication Foundation (WCF) service that returns location information for authorized law enforcement agencies. The service contract is as follows.

Users are authenticated and impersonated. The system uses ASP.NET roles. The members of law enforcement are members of the LawEnforcement role.
You need to ensure that only members of the LawEnforcement role can call these methods.
What are two possible ways to achieve this goal (Each correct answer presents a complete solution? Choose two.)

Users are authenticated and impersonated. The system uses ASP.NET roles. The members of law enforcement are members of the LawEnforcement role.
You need to ensure that only members of the LawEnforcement role can call these methods.
What are two possible ways to achieve this goal (Each correct answer presents a complete solution? Choose two.)
정답: A,B
A Windows Communication Foundation (WCF) service uses the following service contract.
[ServiceContract]
public interface IService
{
[OperationContract]
string Operation 1 (string s);
}
You need to ensure that the operation contract Operationi responds to HTTP POST requests.
Which code segment should you use?
[ServiceContract]
public interface IService
{
[OperationContract]
string Operation 1 (string s);
}
You need to ensure that the operation contract Operationi responds to HTTP POST requests.
Which code segment should you use?
정답: B
A Windows Communication Foundation (WCF) service interacts with the database of a workflow engine. Data access authorization is managed by the database, which raises security exceptions if a user is unauthorized to access it.
You need to ensure that the application transmits the exceptions raised by the database to the client that is calling the service.
Which behavior should you configure and apply to the service?
You need to ensure that the application transmits the exceptions raised by the database to the client that is calling the service.
Which behavior should you configure and apply to the service?
정답: C
You are developing a Windows Communication Foundation (WCF) service named CalculatorService, which implements the ICalculatorService contract. The service is configured to be discoverable through UDP. CalculatorService contains multiple endpoints. One of the endpoints is configured with the following behavior.

You need to log all the endpoint metadata information that is added by the service host. Which code segment should you use?


You need to log all the endpoint metadata information that is added by the service host. Which code segment should you use?

정답: D
A Windows Communication Foundation (WCF) solution uses the following contract to share a message across its clients. (Line numbers are included for reference only.)
01 <ServiceContract()> 02 Public Interface ITeamMessageService 03 04 <OperationContract()> 05 Function GetMessage() As String 06 07 <OperationContract()> 08 Sub PutMessage(ByVal message As String) 09 End Interface The code for the service class is as follows.
10 Public Class TeamMessageService 11 Implements ITeamMessageService 12 13 Dim key As Guid = Guid.NewGuid() 14 Dim message As String = "Today s Message" 15 16 Public Function GetMessage() As String _ 17 Implements ITeamMessageService.GetMessage 18 19 Return String.Format("Message:{0}. Key:{1}", message, key) 20 End Function 21 22 Public Sub PutMessage(ByVal message As String) _ 23 Implements ITeamMessageService.PutMessage 24 25 Me.message = message 26 End Sub 27 28 End Class
The service is self-hosted. The hosting code is as follows.
29 Dim host As ServiceHost = New ServiceHost(GetType(TeamMessageService)) 30 Dim binding As BasicHttpBinding = New BasicHttpBinding(BasicHttpSecurityMode.None)
31 host.AddServiceEndpoint(
"MyApplication.ITeamMessageService", binding,
"http://localhost:12345")
32 host.Open()
You need to ensure that all clients calling GetMessage will retrieve the updated string if the message is updated by any client calling PutMessage.
What should you do?
01 <ServiceContract()> 02 Public Interface ITeamMessageService 03 04 <OperationContract()> 05 Function GetMessage() As String 06 07 <OperationContract()> 08 Sub PutMessage(ByVal message As String) 09 End Interface The code for the service class is as follows.
10 Public Class TeamMessageService 11 Implements ITeamMessageService 12 13 Dim key As Guid = Guid.NewGuid() 14 Dim message As String = "Today s Message" 15 16 Public Function GetMessage() As String _ 17 Implements ITeamMessageService.GetMessage 18 19 Return String.Format("Message:{0}. Key:{1}", message, key) 20 End Function 21 22 Public Sub PutMessage(ByVal message As String) _ 23 Implements ITeamMessageService.PutMessage 24 25 Me.message = message 26 End Sub 27 28 End Class
The service is self-hosted. The hosting code is as follows.
29 Dim host As ServiceHost = New ServiceHost(GetType(TeamMessageService)) 30 Dim binding As BasicHttpBinding = New BasicHttpBinding(BasicHttpSecurityMode.None)
31 host.AddServiceEndpoint(
"MyApplication.ITeamMessageService", binding,
"http://localhost:12345")
32 host.Open()
You need to ensure that all clients calling GetMessage will retrieve the updated string if the message is updated by any client calling PutMessage.
What should you do?
정답: B
You are creating a Windows Communication Foundation (WCF) service that is implemented as follows.
(Line numbers are included for reference only.)
01|ServiceContract]
02[ServiceBehavior (includeExceptionDetailslnFaults = true) 1
03putiic class OrderService
04{
05[Operation Contract]
06putiic void Submit Order (Order an Order)
07{
O8try
09{
10...
11)
12catch (DivideByZeroExcepton ex)
13{
15)
16)
17)
You need to ensure that the stack trace details of the exception are not included in the error information sent to the client.
What should you do?
(Line numbers are included for reference only.)
01|ServiceContract]
02[ServiceBehavior (includeExceptionDetailslnFaults = true) 1
03putiic class OrderService
04{
05[Operation Contract]
06putiic void Submit Order (Order an Order)
07{
O8try
09{
10...
11)
12catch (DivideByZeroExcepton ex)
13{
15)
16)
17)
You need to ensure that the stack trace details of the exception are not included in the error information sent to the client.
What should you do?
정답: C
A Windows Communication Foundation (WCF) service handles online order processing for
your company.
You discover that many requests are being made with invalid account numbers.
You create a class named AccountNumberValidator that has a method named Validate.
Before the message is processed, you need to validate account numbers with AccountNumberValidator and reject messages with invalid account numbers.
You create a new class that implements the IParameterInspector interface.
Which code segment should you use in this class?
your company.
You discover that many requests are being made with invalid account numbers.
You create a class named AccountNumberValidator that has a method named Validate.
Before the message is processed, you need to validate account numbers with AccountNumberValidator and reject messages with invalid account numbers.
You create a new class that implements the IParameterInspector interface.
Which code segment should you use in this class?
정답: B
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?

Client applications are blocked while the service processes reports. You need to ensure that the service methods are asynchronous. What should you do?
정답: D
You are developing a Windows Communication Foundation (WCF) REST service to provide access to a library book catalog. The following code segment defines the service contract. (Line numbers are included for reference only.)

Library patrons want the ability to search the catalog by title.
You need to ensure that the GetBookByTitle method is exposed as a service method.
Which code segment should you insert at line 05?

Library patrons want the ability to search the catalog by title.
You need to ensure that the GetBookByTitle method is exposed as a service method.
Which code segment should you insert at line 05?
정답: B
You develop a Window Communication Foundation (WCF) service. You have the following requirements: - Create a data contract to pass data between client applications and the service. - Create the data that is restricted and cannot pass between client applications and
the service. You need to implement the restricted data members. Which member access modifier should you use?
the service. You need to implement the restricted data members. Which member access modifier should you use?
정답: B
A Windows Communication Foundation (WCF) solution uses the following contract to share a message across its clients.
(Line numbers are included for reference only.)
01 [ServiceContract]
02public interface ITeamMessageService
03{
04 [OperationContract]
05string GetMessage0;
07 [OperationContract]
08void PutMessage(string message);
09)
The code for the service class is as follows
10 public class TeamMessageService: ITeamMessageService
1 1{
12Guid key = GuicLNewGuidO;
1 3string message = "Today's Message":
1 4public string GetMessage()
i5{
16 return stringFormat("Message:{0} Key:{1}",
message, Key);
1n
1 9public void PutMessage(string message)
20{
2lthismessage = message;
22}
23)
The senvice is self-hosted. The hosting code is as follows.
24 ServiceHost host =
25BasicHttpBinding binding =
new BasicHttpBinding(BasicHttpSecuntyMode.None):
26 host AddServiceEndpoint(
HMyApplication lTeamMessageService, binding,
"http:/Ilocalhost: 12345w);
27 host Open0;)
You need to ensure that all clients calling GetMessage will retrieve the same string, even if the message is updated by clients calling PutMessage
What should you do?
(Line numbers are included for reference only.)
01 [ServiceContract]
02public interface ITeamMessageService
03{
04 [OperationContract]
05string GetMessage0;
07 [OperationContract]
08void PutMessage(string message);
09)
The code for the service class is as follows
10 public class TeamMessageService: ITeamMessageService
1 1{
12Guid key = GuicLNewGuidO;
1 3string message = "Today's Message":
1 4public string GetMessage()
i5{
16 return stringFormat("Message:{0} Key:{1}",
message, Key);
1n
1 9public void PutMessage(string message)
20{
2lthismessage = message;
22}
23)
The senvice is self-hosted. The hosting code is as follows.
24 ServiceHost host =
25BasicHttpBinding binding =
new BasicHttpBinding(BasicHttpSecuntyMode.None):
26 host AddServiceEndpoint(
HMyApplication lTeamMessageService, binding,
"http:/Ilocalhost: 12345w);
27 host Open0;)
You need to ensure that all clients calling GetMessage will retrieve the same string, even if the message is updated by clients calling PutMessage
What should you do?
정답: C
You are developing a data contract for a Windows Communication Foundation (WCF) service.
The data in the data contract must participate in round trips. Strict schema validity is not required.
You need to ensure that the contract is forward-compatible and allows new data members to be added to it.
Which interface should you implement in the data contract class?
The data in the data contract must participate in round trips. Strict schema validity is not required.
You need to ensure that the contract is forward-compatible and allows new data members to be added to it.
Which interface should you implement in the data contract class?
정답: B
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?

Client applications are blocked while the service processes reports. You need to ensure that the service methods are asynchronous.
What should you do?
정답: C
You are developing a Windows Communication Foundation (WCF) service. Client applications require reliable sessions to access the service. Users report that they receive
ServerTooBusyException errors when their client application tries to establish a session. You need to ensure that the service can handle a minimum of 30 client connection requests.
Which ReliableSessionBindingElement property should you configure?
ServerTooBusyException errors when their client application tries to establish a session. You need to ensure that the service can handle a minimum of 30 client connection requests.
Which ReliableSessionBindingElement property should you configure?
정답: B
You are creating a Windows Communication Foundation (WCF) service that accepts claims-based tokens.
You need to ensure that the service can use claims from trading partners even though there are variations on naming for the same elements.
Which two actions should you perform? (Each correct answer presents part of the solution Choose two.)
You need to ensure that the service can use claims from trading partners even though there are variations on naming for the same elements.
Which two actions should you perform? (Each correct answer presents part of the solution Choose two.)
정답: A,D