Microsoft TS: Windows Communication Foundation velopment with Microsoft .NET Framework 4 - 070-513 FREE EXAM DUMPS QUESTIONS & ANSWERS

You have a Windows Communication Foundation (WCF) service.
The service has issues with performance when it receives messages on a specific endpoint. The service must collect the minimum number of performance counters to diagnose the message issues.
You need to configure the service.
In the web.config file for the service, what should you do?
Correct Answer: B Vote an answer
A Windows Communication Foundation (WCF) solution exposes the following service over a TCP binding. (Line numbers are included for reference only.)

MessageDatabase supports a limited number of concurrent executions of its methods.
You need to change the service to allow up to the maximum number of executions of the methods of MessageDatabase. This should be implemented without preventing customers from connecting to the service.
What should you do?
Correct Answer: D Vote an answer
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 <ServiceContract0>
02PuElic Interface ITeamMessageService
04 <OperationContractO>
05Function GetMessage() As String
06
07 <OperationContract0>
08Sub PutMessage(Byval message As String)
O9End Interface
The code for the serAce class is as follows.
10 Public Class TeamMessageService0
11 Implements lTearmt4essageService
12
1 3Dim key As Guid = Guid.NewGuid()
1 4Dim message As String = "Today's Message'
15
16PuUic Function GetMessage0As String -
1 7lmpements lTearm*AessageServiceGetMessage
18
1 9Retun String. Fommat("Message:{0) Key:{ 1}", message, key)
20End Function
21
22PubIic Sub PutMessage(ByV message As Stnng) -
23lmpements lTearrlessageService PutMessage
24
25Me message = message
26End Sub
27
28End Class
The service is self-hosted The hosting code rs as follows
29Dim host As ServiceHost =
New ServiceHost(GetType(TearrwiessageSeMce))?
3ODim binding As Basic HttpBindngt
New BasicHttpBindiig(BasicHttpSecurityMode. None) 31 host.AddServiceEndpoint(
"MyAppication lTearrtAessageService", binding
Thttp /Ilac aihost. 1 2345)
32host Open()
You need to ensure that all clients calling GetMessage will retrieve the same string, even if the message is upd(ed by clients calling PutMessage what should you do?
Correct Answer: C Vote an answer
You develop a Windows Communication Foundation (WCF) service that interacts with Microsoft Message Queuing (MSMQ).
The service requires sessions. You need to create a custom binding that enables messages sent to the queue to be viewed when you are using a listener tool.
Which binding elements should you use?
Correct Answer: A Vote an answer
A Windows Communication Foundation (WCF) service is responsible for transmitting XML documents between systems. The service has the following requirements:
- It must minimize the transmission size by attaching the XML document as is without using escape characters or base64 encoding. - It must interoperate with systems that use SOAP but are not built on the .NET platform.
You need to configure the service to support these requirements.
Which message encoding should you use?
Correct Answer: C Vote an answer
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 ICatalog
{
[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?
Correct Answer: D Vote an answer
An ASP.NET application hosts a RESTful Windows Communication Foundation (WCF) service at /Services/Contoso.svc. The service provides a JavaScript resource to clients. You have an explicit reference to the JavaScript in your page markup as follows.
<script type="text/javaScript" src="/Services/Contoso.svc/js" />
You need to retrieve the debug version of the service JavaScript.
What should you do?
Correct Answer: C Vote an answer
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?
Correct Answer: B Vote an answer
A Windows Communication Foundation (WCF) service implements a contract with one-way and requestreply operations.
The service is exposed over a TCP transport.
Clients use a router to communicate with the service. The router is implemented as follows. (Line numbers are included for reference only.)
01 ServiceHost host = new ServiceHost(typeof(RoutingService));
02 host AddServiceEndpoint(
03 typeof(lSimplexDatagramRouter),
04 new NetTcpBinding0, "net.tcp:/flocalhostlRouter"
05);
06 List <ServiceEndpoints lep new List <ServiceEndpoint>0;t
07 lep.Add(
08 new ServiceEndpoint(
09 ContractDescription.GetContract(
10 typeof(lSimplexDatagramRouter)
11),
12 new NetTcpBinding0,
13 new EndpointAddress|'nettcp://localhost: 8080/Logger")
14)
15);
16 RoutingConfiguration rc new RoutingConfigurationO;
17 FilterTable.Add(new MatchAilMessageFilterO, lep);
18 host. Description. Behaviors. Add(new RoutingBehavior(rc));
Request-reply operations are failing.
You need to ensure that the router can handle one-way and request-reply operations.
What should you do?
Correct Answer: C Vote an answer
A Windows Communication Foundation (WCF) application exposes a service as a SOAP endpoint 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?
Correct Answer: A Vote an answer
You are developing a Windows Communication Foundation (WCF) service that does not operate on a duplex channel.
You find that operations do not start until all previous operations have finished. The service hosting code contains the following lines.
Dim service = New WarehouseService()
Dim hose = New ServiceHost(service)
You need to ensure that new operations do not wait for previous operations to finish.
Which attribute should you use to decorate the service?
Correct Answer: D Vote an answer
0
0
0
10