PrepAway - Latest Free Exam Questions & Answers

Category: 70-513

Exam 70-513: TS: Windows Communication Foundation Development with Microsoft .NET Framework 4

Which line of code should you insert at line 04?

A Windows Communication Foundation (WCF) service is self-hosted in a console application.
The service implements the IDataAccess contract, which is defined in the MyApplication namespace.
The service is implemented in a class named DataAccessService which implements the IDataAccess
interface and also is defined in the MyApplication namespace. The hosting code is as follows.
(Line numbers are included for reference only.)

01 static void Main(string[] args)
02 {
03 ServiceHost host;
04 …
05 host.Open();
06 Console.ReadLine();
07 host.Close();
08 }

You need to create a ServiceHost instance and assign it to the host variable. You also need to instantiate the service host.
Which line of code should you insert at line 04?

What should you do?

A Windows Communication Foundation (WCF) service listens for messages at net.tcp://www.contoso.com/MyService.
It has a logical address at http://www.contoso.com/MyService. The configuration for the WCF client is as follows:

<endpoint address=”http://www.contoso.com/MyService”
binding=”netTcpBinding”
bindingConfiguraton=”NetTcpBinding_IMyService”
contract=”ServiceReference1.IMyService”
name=”NetTcpBinding_IMyService”/>

The generated configuration does not provide enough information for the client to communicate with the server.
You need to update the client so that it can communicate with the server. What should you do?

Which attribute should you apply to the MessageProcessor class?

You are modifying an existing Windows Communication Foundation (WCF) service that is defined as follows:

[ServiceContract]
public interface IMessageProcessor
{
[OperationContract]
void ProcessMessages();
}
public class MessageProcessor: IMessageProcessor
{
public void ProcessMessage();
SubmitOrder();
}

SubmitOrder makes a call to another service. The ProcessMessage method does not perform as expected under a heavy load.
You need to enable processing of multiple messages. New messages must only be processed when the ProcessMessage method is not processing requests,
or when it is waiting for calls to SubmitOrder to return.

Which attribute should you apply to the MessageProcessor class?

What should you do?

A Windows Communication Foundation (WCF) service implements a contract with one-way and request-reply 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(ISimplexDatagramRouter),
04 new NetTcpBinding(), “net.tcp://localhost/Router”
05 );
06 List<ServiceEndpoint> lep = new List<ServiceEndpoint>();
07 lep.Add(
08 new ServiceEndpoint(
09 ContractDescription.GetContract(
10 typeof(ISimplexDatagramRouter)
11 ),
12 new NetTcpBinding(),
13 new EndpointAddress(“net.tcp://localhost:8080/Logger”)
14 )
15 );
16 RoutingConfiguration rc = new RoutingConfiguration();
17 rc.FilterTable.Add(new MatchAllMessageFilter(), 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?

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:

void DeleteItems(string id);

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 class named TestService implements the following interface:

[ServiceContract]
public interface ITestService
{
[OperationContract]
DateTime GetServiceTime();
}

TestService is hosted in an ASP.NET application.
You need to modify the application to allow the GetServiceTime method to return the data formatted as JSON.
It must do this only when the request URL ends in /ServiceTime. What should you do?

Which code segment should you use?

The following is an example of a SOAP envelope.

<s:Envelope xmlns:s=”http://schemas.xmlsoap.org/soap/envelope”>
<s:Header>
<h:StoreId xmlns:h=”http://www.contoso.com”>6495</h:StoreId>
</s:Header>
<s:Body>
<CheckStockRequest xmlns=”http://www.contoso.com”>
<ItemId>2469<ItemId>
</CheckStockRequest>
</s: Body>
</s:Envelope>

You need to create a message contract that generates the SOAP envelope.
Which code segment should you use?

Which code segment should you use?

A Windows Communication Foundation (WCF) application uses the following data contract

[DataContract]
public class Person
{
[DataMember]
public string firstName;
[DataMember]
public string lastName;
[DataMember]
public int age;
[DataMember]
public int ID;
}

You need to ensure that the following XML segment is generated when the data contract is serialized.
<Person>
<firstName xsi:nil=”true”/>
<lastName xsi:nil=”true”/>
<ID>999999999<ID>
</Person>

Which code segment should you use?


Page 14 of 15« First...1112131415