PrepAway - Latest Free Exam Questions & Answers

Which code segment should you use?

You are creating a Windows Communication Foundation (WCF) service. You do not want to
expose the internal implementation at the service layer. You need to expose the following
class as a service named Arithmetic with an operation named Sum. Public Class Calculator
Public Function Add (ByVal x As Integer, ByVal y As Integer) As Integer End Function End
Class Which code segment should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
<ServiceContract(Name:=”Arithmetic”)> Public Class Calculator
<OperationContract(ReplyAction:=”Sum”)> Public Function Add(ByVal x As Integer, ByVal y
As Integer) As Integer End Function End Class

B.
<ServiceContract(Namespace:=”Arithmetic”)> Public Class Calculator
<OperationContract(Action:=”Sum”)> Public Function Add(ByVal x As Integer, ByVal y As
Integer) As Integer End Function End Class

C.
<ServiceContract(ConfigurationName:=”Arithmetic”)> Public Class Calculator
<OperationContract(Action:=”Sum”)> Public Function Add(ByVal x As Integer, ByVal y As
Integer) As Integer End Function End Class

D.
<ServiceContract(Name:=”Arithmetic”)> Public Class Calculator

<OperationContract(Name:=”Sum”)> Public Function Add(ByVal x As Integer, ByVal y As
Integer) As Integer End Function End Class


Leave a Reply