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?

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?

A.
<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

B.
<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

C.
<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

D.
<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



Leave a Reply 0

Your email address will not be published. Required fields are marked *