2014 Latest Pass4sure&Lead2pass Microsoft 70-513 Dumps (61-70)

QUESTION 61
You are developing a Windows Communication Foundation (WCF) service that contains the following service contract.
[ServiceContract()]
public interface IPaymentService
{
[OperationContract()]
void RecordPayments(Person person);
}
public class Person
{ … }
public class Employee : Person
{ … }
public class Customer : Person
{ … }
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 62
You are developing a Windows Communication Foundation (WCF) service to replace an existing ASMX Web service.
The WCF service contains the following code segment. (Line numbers are included for reference only.)
01    [ServiceContract()]
02
03     public interface IEmployeeService
04     {
05        [OperationContract()]
06        EmployeeInfo GetEmployeeInfo(int employeeID);
07
08     }
09
10     public class EmployeeService : IEmployeeService
11     {
12
13        public EmployeeInfo GetEmployeeInfo(int employeeID)
14        {
15              …
16        }
17     }
18
19
20     public class EmployeeInfo
21     {
22         …
23         public int EmployeeID { get; set; }
24         public string FirstName { get; set; }
25         public string LastName { get; set; }
26
27     }
The existing Web service returns the EmployeelD as an attribute of the Employeelnfo element in the response XML.
You need to ensure that applications can consume the service without code changes in the client. What should you do?

A.    Insert the following code at line 02.
[DataContractFormat()]
Insert the following code at line 22.
[DataMember()]
B.    Insert the following code at line 02.
[XmlSerializerFormat()]
Insert the following code at line 22.
[XmlAtttibute()]
C.    Insert the following code at line 09.
[XmlSerializerFormat()]
Insert the following code at line 22.
[XmlAttribute()]
D.    Insert the following code at line 19.
[DataContractFormat()]
Insert the following code at line 22.
[DataMember()]

Answer: D

QUESTION 63
You are developing a Windows Communication Foundation (WCF) service to provide an in-memory cache.
The following code is part of your solution. (Line numbers are included for reference only.)
01
02   public interface IInMemoryCacheService
03   {
04     [OperationContract()]
05     string GetCachedItem(string key);
06
07     [OperationContract()]
08     void CacheItem(string key, string item);
09
10   }
11
12   [ServiceBehavior(InstanceContextMode=InstanceContextMode.Single)]
13   public class CacheService : IInMemoryCacheService
14   {
15
16      Hashtable cache = new Hashtable();
17
18      public string GetCachedItem(string key)
19      {
20         return cache(key).ToString();
21      }
22
23      public void CacheItem(string key, string item)
24      {
25         if (cache.Contains(key))
26             cache.Remove(key);
27         cache.Add(key, item);
28      }
29    }
Users report that the cache is getting updated with cache changes of other users.
You need to ensure that each user’s cache is maintained and isolated from other users.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A.    Insert the following code at line 01.
[ServiceContract(SessionMode=SessionMode.NotAllowed)]
B.    At line 12, replace InstanceContextMode.Single with InstanceContextMode.PerSession.
C.    At line 12, replace InstanceContextMode.Single with InstanceContextMode.PerCall.
D.    Insert the following code at line 01.
[ServiceContract(SessionMode=SessionMode.Required)]

Answer: BD

QUESTION 64
A Windows Communication Foundation (WCF) service is hosted in Microsoft Internet Information Services (IIS).
You are preparing the configuration file for production deployment. You need to set up tracing so that an administrator can adjust
the System.ServiceModel trace level without causing the ASP.NET host application domain to restart.
You need to ensure that tracing is turned off by default. What should you do?

A.    Add the following element to the system.serviceModel configuration section:
<diagnostics wmiProviderEnabled=”true” />
Add the following element to the system.diagnostics configuration section:
<sources>
<source name=”System.ServiceModel” switchValue=”Off”>
<listeners>
<add initializeData=”app_tracelog.svclog”
type=”System.Diagnostics.XmlWriterTraceListener”
name=”ServiceModelTraceListener”
traceOutputOptions=”Timestamp”/>
</listeners>
</source>
</sources>
B.    Add the following element to the system.serviceModel configuration section:
<diagnostics etwProviderId=”{7799e76e-0f8b-407a-a616-3f91ba6072b9}”>
Add the following element to the system.diagnostics configuration section:
<sources>
<source name=”System.ServiceModel” switchValue=”Off”>
<listeners>
<add initializeData=”app_tracelog.svclog”
type=”System.Diagnostics.XmlWriterTraceListener”
name=”ServiceModelTraceListener”
traceOutputOptions=”Timestamp”/>
</listeners>
</source>
</sources>
C.    Add the following element to the system.serviceModel configuration section:
<serviceBehaviors>
<behavior>
<serviceDebug/>
</behavior>
</serviceBehaviors>
Add the following element to the system.diagnostics configuration section:
<sources>
<source name=”System.ServiceModel” switchValue=”ActivityTracing”>
<listeners>
<add initializeData=”app_tracelog.svclog”
type=”System.Diagnostics.XmlWriterTraceListener”
name=”ServiceModelTraceListener”
traceOutputOptions=”Timestamp”/>
</listeners>
</source>
</sources>
D.    Add the following element to the system.serviceModel configuration section:
<serviceBehaviors>
<behavior>
<serviceDebug/>
</behavior>
</serviceBehaviors>
Add the following element to the system.diagnostics configuration section:
<sources>
<source name=”System.ServiceModel” switchValue=”Off”>
<listeners>
<add initializeData=”app_tracelog.svclog”
type=”System.Diagnostics.XmlWriterTraceListener”
name=”ServiceModelTraceListener”
traceOutputOptions=”Timestamp”/>
</listeners>
</source>
</sources>

Answer: A

QUESTION 65
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 66
You are configuring services to be discoverable. The services must be discoverable without relying on a central server.
Client applications that consume the services are on a network segment that is separate from the network segment that the services are located on.
A firewall blocks all TCP ports between the two network segments, but allows other protocols to pass through.
You need to ensure that the client applications can discover the services. What should you do?

A.    Use ad-hoc discovery mode over HTTP.
B.    Use ad-hoc discovery mode over UDP.
C.    Use managed discovery mode over HTTP.
D.    Use managed discovery mode over UDP.

Answer: B

QUESTION 67
You are developing a Windows Communication Foundation (WCF) client application.
The client application contains the following code.
[ServiceContract]
public interface ISocialStatus
{
[OperationContract]
[WebInvoke(UriTemplate = “/statuses/update.xml?status-{text}”)]
void UpdateStatus(string text);
}
public class SocialClient : ClientBase<ISocialStatus>, ISocialStatus
{

}
The configuration file contains the following lines.
<system.serviceModel>
<client>
<endpoint name=”SocialClient” address=”http://contoso.com”
binding=”webHttpBinding” contract=”SocialApp.ISocialStatus”
bindingConfiguration=”BindingConfig”  />
</client>
<bindings />
</system.serviceModel>
You need to ensure that the service is consumed. Which code segment should you use?

A.    var client = new SocialClient(“SocialClient”);
client.Endpoint.Behaviors.Add(new WebHttpBehavior());
B.    var client = new SocialClient(“SocialClient”);
client.Endpoint.Behaviors.Add(new WebScriptEnablingBehovior());
C.    var client = new SocialClient(“POST”);
client.Endpoint.Behaviors.Add(new WebHttpBehovior());
D.    var client = new SocialClient(“POST”);
client.Endpoint.Behaviors.Add(new WebScriptEnablingBehavior());

Answer: A

QUESTION 68
You are developing a new version of an existing message contract named CustomerDetailsVersion1.
The new version of the message contract must add a Department field of type String to the SOAP header.
You create a new class named CustomerDetailsVersion2 that inherits from CustomerDetailsVersion1.
You need to ensure that all client applications can consume the service. Which code segment should you use?

A.    [MessageContract]
public class CustomerDetailsVersion2 : CustomerDetailsVersion1
{
[MessageHeader(MustUnderstand = false)]
public string Department;
}
B.    public class CustomerDetailsVersion2 : CustomerDetailsVersion1
{
[MessageHeader(MustUnderstand = false)]
public string Department;
}
C.    [MessageContract]
public class CustomerDetailsVersion2 : CustomerDetailsVersion1
{
[MessageHeader(MustUnderstand = true)]
public string Department;
}
D.    public class CustomerDetailsVersion2 : CustomerDetailsVersion1
{
[MessageHeader(MustUnderstand = true)]
public string Department;
}

Answer: A

QUESTION 69
You are developing a Windows Communication Foundation (WCF) service.
You establish that the largest size of valid messages is 8,000 bytes. You notice that many malformed messages are being transmitted.
Detailed information about whether each message is malformed must be logged.
You need to ensure that this information is saved in XML format so that it can be easily analyzed.
What should you add to the service configuration file?

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

Answer: D

QUESTION 70
You are developing a Windows Communication Foundation (WCF) service that must be discoverable.
You need to ensure that the ServiceHost instance supports multiple discovery versions. What should you do?

A.    – Specify a unique DiscoveryVersion parameter for each endpoint constructor.
– Use the same value for the Address property of each endpoint.
B.    – Use the endpoint constructor without the DiscoveryVersion parameter.
– Use a unique value for the Address property of each endpoint.
C.    – Specify a unique DiscoveryVersion parameter for each endpoint constructor.
– Use a unique value for the Address property of each endpoint.
D.    – Use the endpoint constructor without the DiscoveryVersion parameter.
– Use the same value for the Address property of each endpoint.

Answer: C

If you want to pass Microsoft 70-513 successfully, donot missing to read latest lead2pass Microsoft 70-513 practice exams.
If you can master all lead2pass questions you will able to pass 100% guaranteed.

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

         

Comments are closed.