Exam Code: 70-513 (Practice Exam Latest Test Questions VCE PDF)
Exam Name: TS: Windows Communication Foundation Development with Microsoft .NET Framework 4
Certification Provider: Microsoft
Free Today! Guaranteed Training- Pass 70-513 Exam.
2021 Jun 70-513 Study Guide Questions:
Q241. DRAG DROP
You develop a Windows Communication Foundation (WCF) service that is hosted within a console application. The service implements the IRegistrationService interface in a class named RegistrationService. The service uses the following endpoint URL: http://localhost:8080/registrationservice/basic
You need to configure the console application to host the service.
How should you complete the relevant code? (To answer, drag the appropriate code segment to the correct location in the answer area. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)
Answer:
Q242. You are developing a Windows Communication Foundation (WCF) service that returns location information for authorized law enforcement agencies. The service contract is as follows.
Users are authenticated and impersonated. The system uses ASP.NET roles. The members of law enforcement are members of the LawEnforcement role.
You need to ensure that only members of the LawEnforcement role can call these methods.
What are two possible ways to achieve this goal (Each correct answer presents a complete solution? Choose two.)
A. Add a PrincipalPermissionAttribute to each method that should be available only to members of law enforcement. Set its SecurityAction to Demand and set the role equal to LawEnforcement.
B. Use the CurrentPrincipal property of the thread. Call the IsInRole method specifying LawEnforcement as a parameter.
C. Create a GenericPrincipal specifying Thread.CurrentPrincipal.Identity as the IIdentityParameter and LawEnforcement as the only value for the Roles parameter.
D. At the beginning of each method, enumerate each ClaimSet in a new WindowsClaimSet. Use the FindClaims method to locate a claim type named Role with a right named LawEnforcement.
Answer: AB
Q243. You have a Windows Communication Foundation (WCF) service that accepts the following message contract.
You need to ensure that the client sends a SOAP body that is accepted by the service.
A. <Ticket xmlns="http://www.movies. com">
<NumberOfSeats
xmlns="http : //www.movietheater . com">
0
</NumberOfSeats>
<ReservationName xmlns="http://www.movietheater .com" />
<ShowTime
xmlns="http://www.movietheater.com">
2010-07-05T00:SI:10.0999304-05:00
</ShowTime>
</Ticket>
B. <Ticket xmlns="http://www.movietheater.com">
<ShowTime
xmlns="http : //www.movietheater . com">
2010-07-05T00:51:10.0999304-05:00
</ShowTime>
<ReservationName xmlns="http://www.movietheater.com" />
<NumberOfSeats
xmlns="http://www.movietheater.com">
0
</NumberOfSeats>
</Ticket>
C. <Ticket xmlns="http://wwv.movies.com">
<ShowTime
xmlns-"http://www.movietheatec.com">
2010-07-05TOO:51:10.0999304-05:00
</ShowTime>
<Number Of Seats
xmlns="http://www.movietheater.com"> 0
</NumbecOfSeats>
<ReservationName xmlns""http://www.movietheotec.com" />
</Ticket>
D. <Ticket xmlns="http://www. movietheatec.com">
<ShowTime
xmlns-"http://www.movietheater.com">
2010-07-05TOO:51:10.0999304-05:00
</ShowTime>
<NumberOfSeats
xmlns="http://wwv.movietheatec.com"> 0
</NumberOfSeats>
<ReservationName
xmlns="http://www.movletheatec.com" />
</Ticket>
Answer: C
Q244. You need to modify a client application that consumes a Windows Communication Foundation (WCF) service.
The service metadata is no longer available.
You need to modify the previously generated proxy to include asynchronous calls to the service.
What should you do?
A. Update the service reference with the Generate asynchronous operations option.
B. Create a partial class for the previously generated proxy and include the new asynchronous methods.
C. Create a class with the same name as the previously generated proxy and add the new asynchronous methods. Add the new class to a namespace that is different from the original proxy.
D. Create a class with the same name as the previously generated proxy and add the new asynchronous methods as partial methods. Add the new class to a namespace that is different from the original proxy.
Answer: B
Q245. You are developing a Windows Communication Foundation (WCF) service.
The service operation takes a customer number as the only argument and returns information about the customer. The service requires a security token in the header of the message.
You need to create a message contract for the service.
Which code segment should you use?
A. <ServiceContract()>
Public Interface IService
<OperationContract()>
Function GetCustomerInformation(
ByVal header As Header,
ByVal customerNumber As Integer)
As CustomerInformation
End Interface
<DataContract()>
Public Class CustomerInformation
End Class
<MessageContract()>
Public Class Header
<MessageHeader()>
Public SecurityTag As String
End Class
B. <ServiceContract()>
Public Interface IService
<OperationContract()>
Function GetCustomerInformation(
ByVal header As Header, ByVal customerNumber As Integer) As CustomerInformation End Interface <MessageContract()> Public Class CustomerInformation End Class <MessageContract()> Public Class Header <MessageHeader()> Public SecurityTag As String End Class
C. <ServiceContract()> Public Interface IService <OperationContract()> Function GetCustomerInformation( ByVal request As CustomerNumber) As CustomerInformation End Interface <DataContract()> Public Class CustomerInformation End Class <MessageContract()> Public Class CustomerNumber <MessageHeader()> Public SecurityTag As String <MessageBodyMember()> Public CustomerNumberElement As Integer End Class
D. <ServiceContract()> Public Interface IService <OperationContract()> Function GetCustomerInformation( ByVal request As CustomerNumber) As CustomerInformation End Interface <MessageContract()> Public Class CustomerInformation End Class <MessageContract()> Public Class CustomerNumber <MessageHeader()> Public SecurityTag As String <MessageBodyMember()> Public CustomerNumberElement As Integer End Class
Answer: D

Down to date exam 70-513 amazon:
Q246. 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/3avaScript" src="/Secvices/Contoso.svc/js" />
You need to retrieve the debug version of the service JavaScript.
What should you do?
A. In the <<to@ ServiceHost °/o> header for /Services/Contoso.svc, set the Debug attribute to true.
B. In the <<H>@ Page <*to> header, set the Debug attribute to true.
C. In the script tag, add a debug attribute and set its value to true.
D. In the script tag, append debug to the src attribute.
Answer: D
Q247. You are developing a custom service host for a Windows Communication Foundation (WCF) service. The service host is named MovieServiceHost.
You need to deploy the service with the custom service host in Microsoft Internet Information Services (IIS) 7.0.
What should you do?
A. Create a factory for the custom service host. Name the factory MovieServiceHostFactory. In the web.config file, add the following attribute to the <add> element within the <serviceActivations> element, factory="HovieServiceHostFactory"
B. Decorate the custom service host class with the following line. <System.ServiceModel.Activation.ServiceActivationBuildProvider()>
C. Make sure that the service class has a default constructor. Add a public read-only property with the name ServiceHost that returns an instance of the MovieServiceHost class.
D. Create a factory for the custom service host. Name the factory MovieServiceHostFactory. In the .svc file, add the following line. <%3 ServiceHost Service="MovieServiceHostFactory" Language="VB"%>
Answer: A
Q248. DRAG DROP
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:
Q249. 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 originating caller.
What should you do?
A. Set the value of ServiceSecurityContext.Current.WindowsIdentity.ImpersonationLevel to TokenImpersonationLevel.Impersonation.
B. Set the value of ServiceSecurityContext.Current.WindowsIdentity.ImpersonationLevel to TokenImpersonationLevel.Delegation.
C. Set the PrincipalPermissionAttribute on the service contract and update the binding attribute in the endpoint element of the configuration file to wsHttpBinding.
D. Set the PrincipalPermissionAttribute on the service contract and update the bindingConfiguration attribute in the endpoint element of the configuration file to wsHttpBinding.
Answer: B
Q250. 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?
A. In the service configuration diagnostics section, set the value of the performancCounters property to All.
B. Enable the Windows Management Instrumentation (WMI) provider.
C. In the service configuration diagnostics section, set the value of the performanceCounters property to ServiceOnly.
D. Enable message logging for the endpoint.
Answer: A

100% Guarantee 70-513 online test:
Q251. You are developing a Windows Communication Foundation (WCF) service that contains the following code segment.
<ServiceContract()> Public Interface ICustomerService … End Interface Public Class CustomerService Implements ICustomerService … End Class
The service is self-hosted in a console application. Older client applications access the service at http://contoso.com:8080/CustomerService/V1. Newer client applications access the service at http://contoso.com:8080/CustomerService/V2.
You need to ensure that any client application can access the service at either address.
Which code segment should you use?
A. Dim serviceAddress1 As Uri =
New Uri("http://contoso.com:8080/CustomerService/V1")
Dim serviceAddress2 As Uri =
New Uri("http://contoso.com:8080/CustomerService/V2")
Dim host As ServiceHost =
New Service Host(GetType(ICustomerService),
New Uri() {serviceAddress1, serviceAddress2})
B. Dim serviceAddress1 As Uri =
New Uri("http://contoso.com:8080/CustomerService/V1")
Dim serviceAddress2 As Uri =
New Uri("http://contoso.com:8080/CustomerService/V2")
Dim host As ServiceHost =
New ServiceHost(GetType(CustomerService),
New Uri() {serviceAddress1, serviceAddress2})
C. Dim serviceAddress As Uri =
New Uri("http://contoso.com:8080/")
Dim host As ServiceHost =
New Servic eHost(GetType(CustomerService),
New Uri() {serviceAddress})
host.AddServiceEndpoint(GetType(ICustomer Service),
New BasicHttpBinding(), "CustomerService/V1")
host.AddServiceEndp oint(GetType(ICustomerService),
New BasicHttpBinding(), "CustomerService/V2")
D. Dim serviceAddress As Uri =
New Uri("http://contoso.com:8080/")
Dim host As ServiceHost =
New Service Host(GetType(ICustomerService),
New Uri() {serviceAddress})
host.AddServiceEndpoint(GetType(CustomerService),
New BasicHttpBinding(), "CustomerService/V1")
host.AddServiceEnd point(GetType(CustomerService),
New BasicHttpBinding(), "CustomerService/V2")
Answer: D
Q252. 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
Q253. DRAG DROP
You have a client application that consumes a Windows Communication Foundation (WCF) service. The service contains a class named RegistrationService. The RegistrationService class contains two methods named SubmitRegistration and GetRegistrations.
The service has the following requirements:
. The client application must call the SubmitRegistration method synchronously.
. The client application must call the GetRegistrations method asynchronously.
You need to complete the client-side code to call the WCF service.
Which six code segments should you use in sequence? (To answer, move the appropriate six code segments from the list of code segments to the answer area and arrange them in the correct order.)
Answer:
Q254. A Windows Communication Foundation (WCF) service uses a list of application-defined roles for operations.
These roles are stored in a database.
You need to authorize calls against the list of roles retrieved from the database.
Which service behavior should you use to authorize the calls?
A. <serviceAuthorization principalPermissionModez”None” roleProviderNames”SqlProvider” />
B. <serviceAuthorization principalPermissionMode=”None” roleProviderNamee”SqlProvider” Is
C. <serviceAuthorization principalPermissionModes”None” roleProviderNames”SqlProvider” I>
D. <serviceAuthorization principalPermissionModez”None” roleProviderNamez’SqlProvider” />
Answer: B
Q255. A Windows Communication Foundation (WCF) solution uses the following contract.
[ServiceContract(SessionMode SessionModeAllowed)] public interface IMyService {
[OperaionContractQsTerminating false) void lnitialize0;
[OperaionContractQslnitiating false)] Void DoSomethingO;
[OperaionContractQsTerminating true)J void TerminateO;
}
You need to change this interface so that:
‘Initialize is allowed to be called any time before Terminate is called
“DoSomething is allowed to be called only after Initialize is called, and n allowed to be called after Terminate is called “Terminate will be lowed to be called only after Initialize is called Which two actions should you perform (Each correct answer presents part of the solution.
Choose two)
A. Change the ServiceContract attribute of the IMyService interface to the following. ServiceContract(SessionMode = SessionMode Required)
B. Change the ServiceContract attribute of the IMyService interface to the following ServiceContract(SessionMode SessionMode Allowed)
C. Change the OperationContract attribute of the Initialize operation to the following. OperationContract(initiating = true, IsTerminating = false)
D. Change the OperationContract attribute of the Terminate operation to the following OperationContract(klnitiating = fase, IsTerminating = true)
Answer: AD
see more 70-513 dumps