What are two possible ways to achieve this goal?
A WCF service code is implemented as follows. (Line numbers are included for reference only.)
01 <ServiceContract()>
02 <ServiceBehavior(
03 InstanceContextMode:=InstanceContextMode.Single)>
04 Public Class CalculatorService
05
06 <OperationContract()>
07 Public Function Calculate(ByVal op1 As Double,
08 ByVal op As String, ByVal op2 As Double) As Double …
24 End Function
25
26 End Class
You need to decrease the response time of the service. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
What should you do?
A Windows Communication Foundation (WCF) client uses the following service contract. (Line numbers are included for reference only.)
01 <ServiceContract()>
02 Public Interface IService
03
04 <OperationContract()>
05 Function Operation1() As String
06 <OperationContract()>
07 Function Operation2() As String
08
09 End Interface
You need to ensure that all calls to Operation1 and Operation2 from the client are encrypted and signed. What should you do?
What should you do?
You are creating a Windows Communication Foundation (WCF) service to process orders. The data contract for the order is defined as follows. <DataContract()>
Public Class Order …
<DataMember()>
Public Property CardHolderName As String
<DataMember()>
Public Property CreditCardNumber As String
End Class
You have the following requirements:
Enable the transmission of the contents of Order from the clients to the service. Ensure that the contents of CreditCardNumber are not sent across the network in clear text. Ensure that the contents of CreditCardNumber are accessible by the service to process the order. You need to implement the service to meet these requirements. What should you do?
<transport clientCredentialType="Basic" ?
You are developing an application to update a user’s social status. You need to consume the service using Windows Communication Foundation (WCF). The client configuration is as follows.
<system.serviceModel>
<bindings>
<webHttpBinding>
<binding name=”SocialConfig”>
<security mode=”TransportCredentialOnly”>
<transport clientCredentialType=”Basic” ?realm=”Social API” />
</security>
</binding>
</webHttpBinding>
</bindings>
<client>
<endpoint address=”http://contoso.com” binding=”webHttpBinding” bindingConfiguration=”SocialConfig” contract=”ISocialStatus” name=”SocialClient” />
</client>
</system.serviceModel>
The service contract is defined as follows.
<ServiceContract()>
Public Interface ISocialStatus <OperationContract()> <WebInvoke(UriTemplate:=”/statuses/update.xml?status={text}”)> Sub UpdateStatus(ByVal text As String) End Interface
Which code segment should you use to update the social status?
Which code segment should you use?
You are consuming a Windows Communication Foundation (WCF) service in an ASP.NET Web application. The service interface is defined as follows.
<ServiceContract()>
Public Interface ICatalog
<OperationContract()>
<WebGet(UriTemplate:=”/Catalog/Items/{id}”, ResponseFormat:=WebMessageFormat.Json)>
Function RetrieveItemDescription(ByVal id As Integer) As String
End Interface
The service is hosted at /Catalog.svc. You need to call the service using jQuery to retrieve the description of an item as indicated by a variable named itemId. Which code segment should you use?
What should you do?
A Windows Communication Foundation (WCF) service has a callback contract. You are developing a client application that will call this service. You must ensure that the client application can interact with the WCF service. What should you do?
Which class should you use?
You are building a client for a Windows Communication Foundation (WCF) service. You need to create a proxy to consume this service. Which class should you use?
What should you do?
You are creating a Windows Communication Foundation (WCF) service that implements operations in a RESTful manner. You need to add a delete operation. You implement the delete method as follows.
Sub DeleteItems(ByVal id As String)
You need to configure WCF to call this method when the client calls the service with the HTTP DELETE operation. What should you do?
What should you do?
A Windows Communication Foundation (WCF) application uses a data contract that has several data members. You need the application to throw a SerializationException if any of the data members are not present when a serialized instance of the data contract is deserialized.
What should you do?
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?