1.
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)]
string RetrieveItemDescription(int id);
}
The service is hosted at Catalogsvc
You need to call the service using jQuery to retrieve the description of an item as indicated by a variable named
itemld. Which code segment should you use?
2.
You are consuming a Windows Communication Foundation (WCF) service.
The service interface is defined as follows:
[DataContract(Namespace = '']
public class Item
{
[ServiceContract(Namespace = '')]
public interface Catalog
{
[OperationContract]
[WebInvoke(Method="POST", UriTemplate="Item")]
Item UpdateItem(Item item);
}
}
The client application receives a WebResponse named response with the response from the service. You need to deserialize this response into a strongly typed object representing the return value of the method.
Which code segment should you use?
3.
A Windows Communication Foundation (WCF) application exposes a service as a SOAP end point for consumption by cross-platform clients.
During integration testing, you find that one of the clients is not generating the correct messages to the WCF application.
In order to debug the issue and fix the communication, you need to configure the service to log messages received from the client
What should you do?
4.
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?
5.
A Windows Communication Foundation (WCF) client application is consuming an RSS syndication feed from a blog.
You have a SyndicaionFeed variable named feed. The application iterates through the items as follows. (Line numbers are included for reference only.)
01 foreach (SyndicationItem item in feed.Items)
02 {
03 }
You need to display the content type and body of every syndication item to the console Which two lines of code should ou insert between lines 02 and 03?
6.
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 string CardHolderName { get; set;}
[DataMember]
public string CreditCardNumber { get; set; }
}
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?
7.
You are creating a Windows Communication Foundation (WCF) service that accepts messages from clients when they are started The message is defined as follows
[MessageContract]
public class Agent
{
public string CodeName { get; set: }
public string SecretHandshake { get; set; }
}
You have the following requirements:
-The CodeName property must be sent in clear text.
-The service must be able to verify that the property value was not changed after being sent by the client.
-The SecretHandshake property must not be sent in clear text and must be readable by the service.
What should you do?
8.
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 string Operation1();
06 [OperationContract]
07 string Operation2();
08 }
You need to ensure that all calls to Operation1 and Operation2 from the client are encrypted and signed What should you do?
9.
You are creating a Windows Communication Foundation (WCF) service that implements the following service contract.
[ServiceContract]
public interface IOrderProcessing
{
[OperationContract]
void ApproveOrder(int id);
}
You need to ensure that only users with the Manager role can call the ApproveOrder method What should you do?
10.
You are developing a Windows Communication Foundation (WCF) service. The service needs to access out- of-process resources
You need to ensure that the service accesses these resources on behalf of the onginating caller. What should you do?