web analytics

Free Share The Newest Microsoft MCTS Exam Questions And Answers From PassLeader

[Pass Ensure VCE Dumps] New Version 341q 70-513 Exam VCE and PDF Dumps Collection (61-80)

Being tormented to get well prepared for your 70-513 exam? Don’t worry! PassLeader now offer the first-hand 70-513 exam dumps, you will pass 70-513 exam for your first try with PassLeader’s latest real 341q 70-513 exam questions. We offer you the newest 70-513 exam study guide with VCE test engine or PDF format braindumps, you can get the basic knowledge and all details about 70-513 exam. Do not hesitate to try our high quality 341q 70-513 practice tests!

keywords: 70-513 exam,341q 70-513 exam dumps,341q 70-513 exam questions,70-513 pdf dumps,70-513 practice test,70-513 vce dumps,70-513 study guide,70-513 braindumps,TS: Windows Communication Foundation Development with Microsoft .NET Framework 4 Exam

QUESTION 61
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 int Add(int x, int y)
{
}
}
Which code segment should you use?

A.    [ServiceContract(Namespace=”Arithmetic”)]
public class Calculator
{
[Operation Contract(Action=”Sum”)]
public int Add(int x, int y)
{}
}
B.    [ServiceContract(ConfigurationName=”Arithmetic”)]
public class Calculator
{
[Operation Contract(Action=”Sum”)]
public int Add(int x, int y)
{}
}
C.    [ServiceContract(Name=”Arithmetic”)]
public class Calculator
{
[OperationContract(Name=”Sum”)]
public int Add(int x, int y)
{}
}
D.    [ServiceContract(Name=”Arithmetic”)]
public class Calculator
{
[OperationContract(ReplyAction=”Sum”)]
public int Add(int x, int y)
{}
}

Answer: C

QUESTION 62
You develop a Windows Communication Foundation (WCF) service. Many client applications will consume the service. You have the following requirements:
– You must enable client sessions on the service.
– The service must support multi-threaded operations.
– If a client application uses sessions, the lifetime of the service instance must be scoped to the lifetime of the session.
– If a client application does not use sessions, the lifetime of the service must be scoped to the lifetime of a method cal.
You need to configure the service. What should you do? (Each correct answer presents part of the solution. Choose three.)

A.    In the ServiceContract attribute, set the value of the InstanceContextMode property to InstanceContextMode.PerSession.
B.    In the ServiceContract attribute, set the value of the SessionMode property to SessionMode.Allowed.
C.    In the ServiceBehavior attribute, set the value of the InstanceContextMode property to InstanceContextMode. PerSession.
D.    In the ServiceContract attribute, set the value of the ConcurrencyMode property to ConcurrencyMode.Multiple.
E.    In the ServiceBehavior attribute, set the value of the ConcurrencyMode property to ConcurrencyMode.Multiple.
F.    In the ServiceBehavior attribute, set the value of the SessionMode property to SessionMode.Allowed.

Answer: BCE

QUESTION 63
You are developing a Windows Communication Foundation (WCF) service that contains the following service contract. You need to ensure that RecordPayments can correctly deserialize into an Employee or a Customer object. What should you do?

A.    Add the following KnownType attribute to the Employee class and to the Customer class.
[KnownType(GetType(Person))]
B.    Implement the IExtensibleDataObject interface in the Person class.
C.    Implement the IExtension(ofType(T)) interface in the Person class.
D.    Add the following KnownType attributes to the Person class.
[KnownType(GetType(Employee))]
[KnownType(GetType(Customer))]

Answer: D

QUESTION 64
A Windows Communication Foundation (WCF) solution uses the following contracts. (Line numbers are included for reference only.)
01 [ServiceContract(CallbackContract=typeof(INameService))]
02 public interface IGreetingService
03 {
04 [OperationContract]
05 string GetMessage();
06 }
07
08 [ServiceContract]
09 public interface INameService
10 {
11 [OperationContract]
12 string GetName();
13 }
When the client calls GetMessage on the service interface, the service calls GetName on the client callback. In the client, the class NameService implements the callback contract. The client channel is created as follows:
22 InstanceContext callbackContext = new InstanceContext(new NameService(“client”));
23 …
24 …
25 DuplexChannelFactory<IGreetingService> factory = new DuplexChannelFactory<IGreetingService>(typeof(NameService), binding, address);
26 IGreetingService greetingService = factory.CreateChannel();
You need to ensure that the service callback is processed by the instance of NameService. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

A.    Change line 25 to the following code segment:
DuplexChannelFactory<IGreetingService> factory = new DuplexChannelFactory<IGreetingService>(callbackContext, binding, address);
B.    Change line 26 to the following code segment:
IGreetingService greetingServicefactory = CreateChannel(callbackContext);
C.    Add the following code segment after line 26:
callbackContext.IncomingChannels.
Add((IDuplexChannel)greetingService);
D.    Add the following code segment after line 26:
callbackContext.OutgoingChannels.
Add((IDuplexChannel)greetingService);

Answer: AB

QUESTION 65
You are using tracing to diagnose run-time issues when you look at the traces for the service in Svc Trace viewer exe, you see what is shown in the exhibit (Click the Exhibit button). The exception trace is selected in Svc Trace reviewer exe. You need to interpret the trace results to determine where the error occurred and what to do next. What should you do?

A.    This issue occurred in the ServiceHost during ServiceHost.Open().
Enable WMI by adding the following configuration to the system.serviceModel configuration section in the application configuration file
<diagnostics wmiProviderEnabled=”true”/>
Restart the application and inspect the endpoints visible through WMI.
B.    This issue occurred in the ServiceHost during ServiceHost.Open().
Compare the security settings for any endpoints that use an MSMQ transport to the security configuration of the MSMQ queue used by the endpoint.
C.    This issue occurred at the ServiceHost when receiving a message.
Compare the security configurations on the client and server to make sure that they are compatible.
D.    This issue occurred at the ServiceHost when accepting an initial set of messages from MSMQ.
Log all messages sent between the client and the sever.

Answer: B

QUESTION 66
You are creating an ASP.NET web application that hosts several Windows Communication Foundation (WCF) services. The services have ASP.NET Compatibility Mode enabled. Users authenticate with the Web application by using a cookie-based ASP.NET Forms Authentication model. You add a service file named Authentication.svc that contains the following code segment:
<%@ ServiceHost Service=”System.Web.ApplicationServices.AuthenticationService” Factory=”System.Web.ApplicationServices.ApplicationServicesHostFactory” %>
You need to ensure that users can access the WCF services without having to re-authenticate. Which two configuration settings should you add? (Each is part of a complete solution. Choose two.)

A.    In the system web. Extensions scripting/webServices/authenticationService element, set the enabled attribute to true.
B.    In the system web. Extensions scripting/webServices/profileService element, set the enabled attribute to true.
C.    Add a service endpoint with basicHttpBinding for the contract System.Web.ApplicationServices.AuthenticationService.
D.    Add a custom service behavior named AuthenticationService Type Behaviors with a service AuthenticationManager element that has service AuthenticationManagerType set to System.Web.Security.SQL Membership Provider.

Answer: AC

QUESTION 67
You are developing a Windows Communication Foundation (WCF) service. You must record all available information for the first 1,000 messages processed, even if they are malformed. You need to configure the message logging section of the configuration file. Which configuration segment should you use?

A.    <messageLogging logEntireMessage=”true”
logMalformedMessages=”true”
logMessagesAtServiceLevel=”true”
logMessagesAtTransportLevel=”true”
maxMessagesToLog=”1000″/>
B.    <messageLogging logMessagesAtServiceLevel=”true”
logMessagesAtTransportLevel=”true”
maxMessagesToLog=”1000″/>
C.    <messageLogging logEntireMessage=”false”
logMessagesAtServiceLevel=”true”
logMessagesAtTransportLevel=”false”
maxMessagesToLog=”1000″/>
D.    <messageLogging logMalformedMessages=”true”
logMessagesAtServiceLevel=”true”
logMessagesAtTransportLevel=”false”
maxMessagesToLog=”1000″/>

Answer: A

QUESTION 68
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?

A.    DataContractSerializer s = new DataContractSerializer(typeof(Item));
Item item = s.ReadObject(response.GetResponseStream()) as Item;
B.    BinaryFormatter f = new BinaryFormatter();
Item item = f.Deserialize(response.GetResponseStream() as Item;
C.    XmlDictionaryReader r = JsonReaderWriterFactory.CreateJsonReader(response.GetResponseStream(), XmlDictionaryReaderQuotas.Max);
DataContractSerializer s = new DataContractSerializer(typeof(Item));
Item item = s.ReadObject(r) as Item;
D.    DataContractJsonSerializer s = new DataContractJsonSerializer(typeof(Item));
Item item = s.ReadObject(response.GetResponseStream()) as Item;

Answer: A

QUESTION 69
You are developing a Windows Communication Foundation (WCF) service that contains the following operation contract.
[OperationContract]
CustomerNames GetCustomerNames();
The operation returns customer names. You need to develop a definition for the operation contract that produces XML with the following structure. Which code segment should you use?

A.    [MessageContract(IsWrapped = false)]
public class CustomerNames
{
   [MessageBodyMember]
   public string[] Names;
}
B.    [MessageContract(WrapperName = “”)]
public class CustomerNames
{
   [MessageBodyMember]
   public string[] Names;
}
C.    [DataContract]
public class CustomerNames
{
   [DataMember]
   public string[] Names;
}
D.    [DataContract]
public class CustomerNames
{
   [DataMember(IsRequired = false)]
   public string[] Names;
}

Answer: A

QUESTION 70
You are developing a Windows Communication Foundation (WCF) service that is hosted by a Windows Forms application. The ServiceHost instance is created in the Form constructor. You need to ensure that the service is not blocked while the UI thread is busy. What should you do?

A.    Decorate the service implementation class with the following line of code:
[ServiceBehavior(UseSyncronizationContext = false)]
B.    Decorate the service implementation class with the following line of code:
[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)]
C.    Call the Invoke method of the form and supply a delegate.
D.    Call the BeginInvoke method of the form and supply a delegate.

Answer: A


http://www.passleader.com/70-513.html

QUESTION 71
Drag and Drop Question
You are developing a Windows Communication Foundation (WCF) service that contains a method named ProcessPayments. The service is hosted in Internet Information Services (IIS). You have the following requirements:
– Create a new instance of the service every time that a client application calls the ProcessPayments method.
– Process every call from client applications one at a time.
You need to complete the code for the WCF service. Which four code segments should you use in sequence? (To answer, move the appropriate code segments from the list of code segments to the answer area and arrange them in the correct order.)

Answer:

QUESTION 72
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?

A.    Set an etwTracking behavior on the service and configure a listener for the System.ServiceModel trace source.
B.    Set an etwTracking behavior on the service and configure a listener for the System.ServiceModel.MessageLogging trace source.
C.    Enable messageLogging in the System.ServiceModel diagnostics element configuration and configure a listener for the System.ServiceModel.MessageLogging trace source.
D.    Enable messageLogging in the System.ServiceModel diagnostics element configuration and configure a listener for the System.ServiceModel trace source.

Answer: C

QUESTION 73
You are creating a Windows Communication Foundation (WCF) service that is implemented as follows.(Line numbers are included for reference only.)
01 [ServiceContract]
02 [ServiceBehavior(IncludeExceptionDetailsInFaults = true)]
03 public class OrderService
04 {
05     [OperationContract]
06     public void SubmitOrder(Order anOrder)
07     {
08         try
09         {
10             …
11         }
12         catch(DivideByZeroException ex)
13         {
14             …
15         }
16     }
17 }
You need to ensure that the stack trace details of the exception are not included in the error information sent to the client. What should you do?

A.    Replace line 14 with the following line:
throw;
B.    Replace line 14 with the following line:
throw new FaultException<Order>(anOrder, ex.ToString());
C.    After line 05, add the following line:
[FaultContract(typeof(FaultException<Order>))]
Replace line 14 with the following line:
throw ex;
D.    Alter line 05, add the following line:
[FaultContract(typeof(FaultException<Order>))]
Replace line 14 with the following line:
throw new FaultException<Order>(anOrder, “Divide by zero exception”);

Answer: D

QUESTION 74
You develop an ASP.NET web application that is hosted in the virtual directory named SecureApp. The web application uses the ASP.NET membership provider. The application pool for the website uses the dedicated domain account named MyDomain\WebServiceAccount. The web.config file contains the connectionStrings element. You need to secure the connectionStrings element for the web application. Which of the following two commands must you run at a command prompt? (Each correct answer presents part of the solution. Choose two.)

A.    aspnet_regiis -pe “connectionStrings” -app “MyDomain\WebServiceAccount”
B.    aspnet_regiis -pe “connectionStrings” -app “/SecureApp”
C.    aspnet_regsql -pa “NetFrameworkConfigurationKey” “MyDomain\WebServiceAccount”
D.    aspnet_regiis -pa “NetFrameworkConfigurationKey” “MyDomain\WebServiceAccount”

Answer: BD

QUESTION 75
A client application calls a Windows Communication Foundation (WCF) service with a proxy class that was generated by Visual Studio. The service binding was changed from wsHttpBinding to basicHttpBinding. The method signatures in the service contract are changed. After these changes, the client application receives errors when calling methods on the service. You need to ensure that the client can invoke methods on the service successfully. What should you do?

A.    Update the configuration file to use basicHttpBinding.
B.    Enable anonymous authentication for the service.
C.    Copy the configuration file elements under the <system.serviceModel> element from the service back to the client.
D.    Update the service reference.

Answer: D

QUESTION 76
You are developing a Windows Communication Foundation (WCF) service. You enable message logging, trace listeners, activity propagation, and tracing on the trace sources. You have the following code segment in the client application. (Line numbers are included for reference only.)

You encounter errors when your client application consumes the service. You need to ensure that your client application can correlate tracing information with the service. Which code segment should you add at line 04?

A.    Option A
B.    Option B
C.    Option C
D.    Option D

Answer: C

QUESTION 77
Drag and Drop Question
You use Visual Studio to develop a Windows Communication Foundation (WCF) service. The service is not hosted. You cannot use the WcfTestClient.exe tool to test the service. You need to test the service from a separate Visual Studio solution that contains a simple console application. Which four actions should you perform in sequence? (To answer, move the appropriate four actions from the list of actions to the answer area and arrange them in the correct order.)

Answer:

QUESTION 78
You are developing a Windows Communication Foundation (WCF) REST service to provide access to a library book catalog. The following code segment defines the service contract. (Line numbers are included for reference only.) Library patrons want the ability to search the catalog by title. You need to ensure that the GetBookByTitle method is exposed as a service method. Which code segment should you insert at line 05?

A.    [WebGet(UriTemplate = “Book/{title}”)]
B.    [WebGet(UriTemplate = “BookByTitle/{title}”)]
C.    [WebGet(UriTemplate = “Book/{titleToSearch}”)]
D.    [WebGet(UriTemplate = “{titleToSearch}”)]

Answer: B

QUESTION 79
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 plafform.
You need to configure the service to support these requirements. Which message encoding should you use?

A.    Binary message encoding
B.    MTOM (Message Transmission Optimization Mechanism) message encoding
C.    Text message encoding with message version set to none
D.    Text message encoding with message version set to SOAP 1.2

Answer: B

QUESTION 80
A Windows Communication Foundation (WCF) service is self-hosted in a console application. The service implements the lTimeService service interface in the TimeService class. You need to configure the service endpoint for HTTP communication. How should you define the service and endpoint tags?

A.    Define the service tag as follows:
<service name=”TimeService”>
Define the endpoint tag as follows:
<endpoint kind=”TimeService”
address=”http://localhost:8080/TimeService”
binding=”wsHttpBinding” contract=”ITimeService”/>
B.    Define the service tag as follows:
<service name=”TimeService”>
Define the endpoint tag as follows:
<endpoint kind=”ITimeService”
address=”http://localhost:8080/TimeService”
binding=”wsHttpBinding” contract=”ITimeService” />
C.    Define the service tag as follows:
<service name=”ITimeService”>
Define the endpoint tag as follows:
<endpoint name=”TimeService”
address=”http://localhost:8080/TimeService”
binding=”wsHttpBinding” contract=”ITimeService”/>
D.    Define the service tag as follows:
<senvice name=”TimeService”>
Define the endpoint tag as follows:
<endpoint address=”http://localhost:8080/TimeService”
binding=”wsHttpBinding” contract=”ITimeService”/>

Answer: D


http://www.passleader.com/70-513.html