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 { ... } The configuration file contains the following lines. binding="webHttpBinding" contract="SocialApp.ISocialStatus" bindingConfiguration="BindingConfig" / 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());

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 { ... } The configuration file contains the following lines. binding="webHttpBinding" contract="SocialApp.ISocialStatus" bindingConfiguration="BindingConfig" /> 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());

相关考题:

You are developing a Windows Communication Foundation (WCF) service. The following code defines and implements the service. (Line numbers are included for reference only.)01 [ServiceContract(SessionMode = SessionMode.Allowed)]02 public interface ICatchAll03 {04 [OperationContract(IsOneWay = false, Action = *, ReplyAction = *)]05 Message ProcessMessage(Message message);06 }0708 public class CatchAllService : ICatchAll09 {10 public Message ProcessMessage(Message message)11 {1213 ...14 return returnMsg;15 }16 }You need to ensure that two identical copies of the received message are created in the service.Which code segment should you insert at line 12?()A.B.C.D.

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.)01 Guid multiCallActivityId = Guid.NewGuid();02 TraceSource ts = new TraceSource(Multicall);03 Trace.CorrelationManager.ActivityId = multiCallActivityId;04You 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.B.C.D.

You are developing a Windows Communication Foundation (WCF) service. Client applications require reliable sessions to access the service.Users report that they receive ServerTooBusyException errors when their client application tries to establish a session. You need to ensure that the service can handle a minimum of 30 client connection requests.Which ReliableSessionBindingElement property should you configure?()A. MaxRetryCountB. MaxTransferWindowSizeC. MaxPendingChannelsD. InactivityTimeout

You are developing a client application that consumes a Windows Communication Foundation (WCF) service.The operation contract is as follows.[OperationContract][FaultContract(typeof(SalesFault))]string GetSales(string saleId);()The service configuration file contains the following line in the serviceBehaviors section.A divide-by-zero exception is not being handled by the service.You need to ensure that the exception is caught in the client application.Which type of exception should the client catch?()A. TimeoutExceptionB. FaultExceptionC. DivideByZeroExceptionD. FaultExceptionSalesFault

You are creating an application that consumes a Windows Communication Foundation (WCF) service. The service implements the IService contract. The client application contains the CallbackHandler class, which implements IServiceCallback.You need to ensure that a client proxy is created that can communicate with the service over a duplex channel.Which code segment should you use?()A.B.C.D.

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{...}The configuration file contains the following lines.binding=webHttpBinding contract=SocialApp.ISocialStatusbindingConfiguration=BindingConfig /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());

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()]0203 public interface IEmployeeService04 {05 [OperationContract()]06 EmployeeInfo GetEmployeeInfo(int employeeID);0708 }0910 public class EmployeeService : IEmployeeService11 {1213 public EmployeeInfo GetEmployeeInfo(int employeeID)14 {15 ...16 }17 }181920 public class EmployeeInfo21 {22 ...23 public int EmployeeID { get; set; }24 public string FirstName { get; set; }25 public string LastName { get; set; }2627 }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?()

following code segment.[ServiceContract]public interface ICustomerService{...}public class CustomerService : ICustomerService{...}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.B.C.D.

You want to debug the Windows Communication Foundation (WCF) client and server interaction through message and application tracing.You need to correlate traces generated on the client and the server. Which XML segment should you add to the system.diagnostics configuration element in the client and server application configuration file?()A.B.C.D.

A Windows Communication Foundation (WCF) client and service share the following service contract interface:[ServiceContract]public interface IContosoService{[OperationContract]void SavePerson(Person person);}They also use the following binding:NetTcpBinding binding = new NetTcpBinding() { TransactionFlow = true };The client calls the service with the following code:using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required)){IContosoService client = factory.CreateChannel();client.SavePerson(person);Console.WriteLine(Transaction.Current.TransactionInformation.DistributedIdentifier);ts.Complete();}The service has the following implementation for SavePerson:public void IContosoService.SavePerson(Person person){person.Save();Console.WriteLine(Transaction.Current.TransactionInformation.DistributedIdentifier);}The distributed identifiers do not match on the client and the server.You need to ensure that the client and server enlist in the same distributed transaction. What should you do?()

A Windows Communication Foundation (WCF) client uses the following service contract.(Line numbers are included for reference only.)01 [ServiceContract]02 public interface IService03 {04 [OperationContract]05 string Operation1();06 [OperationContract]07 string Operation2();08 }You need to ensure that all calls to Operation1 and Operation2 from the client are encrypted and signed. What should you do?()A. Set the ProtectionLevel property in line 01 to EncryptAndSign.B. Set the ProtectionLevel property in line 04 and line 06 to Sign.C. Add a SecurityCriticalAttribute ror each operation.D. Add a SecunitySafeCriticalAttribute for each operation.

A Windows Communication Foundation (WCF) service has a callback contract. You are developing a client application that will call this service.You must ensure that the client application can interact with the WCF service. What should you do?()A. On the OperationContractAttribute, set the AsyncPattern property value to true.B. On the OperationContractAttribute, set the ReplyAction property value to the endpoint address of the client.C. On the client, create a proxy derived from DuplexClientBaseTChannel .D. On the client, use GetCallbackChannelT .

A Windows Communication Foundation (WCF) service implements the following contract. [ServiceContract] public interface IHelloService { [OperationContract(WebGet(UriTemplate="hello?name={name}"))] A.B.C.D.

A Windows Communication Foundation (WCF) service uses the following service contract. [ServiceContract] public interface IService{ [OperationContract] string Operation1(string s);}You need to ensure that the operation contract Operation1 responds to HTTP POST requests.Which code segment should you use?()A.B.C.D.

A Windows Communication Foundation (WCF) service has a callback contract. You are developing a client application that will call this service. You must ensure that the client application can interact with the WCF service. What should you do? ()A、 On the OperationContractAttribute, set the AsyncPattern property value to True.B、 On the OperationContractAttribute, set the ReplyAction property value to the endpoint address of the client. For interactive and self-paced preparation of exam 70-513, try our practice exams. Practice exams also include self assessment and reporting features!C、 On the client, create a proxy derived from DuplexClientBase(Of TChannel).D、 On the client, use GetCallbackChannel(Of T).

You are modifying a Windows Communication Foundation (WCF) service that allows customers to update financial data. The service currently requires a transaction from the client application and is working correctly. The service contract is defined as follows. (Line numbers are included for reference only.) 01 [ServiceContract( )] 02 public interface IDataUpdate 03 { 04 [OperationContract( )] 05 [TransactionFlow(TransactionFlowOption.Mandatory)] 06 void Update(string accountNumber, double amount); 07 08 } 09 10 public class UpdateService : IDataUpdate 11 { 12 13 [OperationBehavior(TransactionScopeRequired=true, TransactionAutoComplete=true)] 14 public void Update(string accountNumber, double amount) 15 { 16 try 17 { 18 ... 19 } 20 catch(Exception ex) 21 { 22 ... 23 } 24 } 25 }The service must be modified so that client applications do not need to initiate a transaction when calling the operation. The service must use the client application’s transaction if one is available. Otherwise it must use its own transaction.You need to ensure that the service operation is always executed within a transaction. What should you do?()A、Replace line 05 with the following code. [TransactionFlow(TransactionFlowOption.NotAllowed)]B、Replace line 13 with the following code. [OperationBehavior(TransactionScopeRequired=false, TransactionAutoComplete=true)]C、Replace line 05 with the following code. [TransactionFlow(TransactionFlowOption.Allowed)]D、Replace line 13 with the following code. [OperationBehavior(TransactionScopeRequired=false, TransactionAutoComplete=false)]

You are creating a Windows Communication Foundation (WCF) service that implements the following service contract.[ServiceContract]public interface IOrderProcessing { [OperationContract] void ApproveOrder(int id);}You need to ensure that only users with the Manager role can call the ApproveOrder method. What should you do?()A、In the method body, check the Rights PosessesProperty property to see if it contains ManagerB、Add a PrincipalPermission attribute to the method and set the Roles property to ManagerC、Add a SecurityPermission attribute to the method and set the SecurityAction to DemandD、In the method body, create a new instance of WindowsClaimSet. Use the FindClaims method to locate a claimType named Role with a right named Manager

A Windows Communication Foundation (WCF) solution uses the following contract: [ServiceContract(SessionMode=SessionMode.Allowed)]public interface IMyService{ [OperationContract(IsTerminating=false)] void Initialize( ); [OperationContract(IsInitiating=false)] void DoSomething( ); [OperationContract(IsTerminating=true)] void Terminate( );} You need to change this interface so that: lnitialize is allowed to be called at any time before Terminate is called. DoSomething is allowed to be called only after Initialize is called, and not allowed to be called after Terminate is called. Terminate will be allowed to be called only after Initalize is called.Which two actions should you perform? (Each correct answer presents part of the sdution. Choose two)()。A、Change the ServiceContract attribute of the IMyService interface to the following. [ServiceContract(SessionMode=SessionMode.Required)]B、Change the ServiceContract attrbute of the IMyService interface to the following [ServiceContract(SessionMode=SessionMode.Allowed)]C、Change the OperationContract attribute of the Initialize operation to the following. [OperationContract(IsInitiating = true, IsTerminating = false)]D、Change the OperationContract attribute of the Terminate operation to the following [OperationContract(IsInitiating = false, IsTerminating = true)]

You are creating a Windows Communication Foundation (WCF) service. The service endpoints change frequently. On the service, you add a new ServiceDiscoveryBehavior to the Behaviors collection of the ServiceHost Description property. You need to ensure that client applications can communicate with the service and discover changes to the service endpoints. What should you do?()A、Add a new ServiceDiscoveryBehavior to the Behaviors collection in the client application.B、Add a new AnnouncementClient to the Behaviors collection in the client application.C、Use the FindCriteria class and the UdpDiscoveryEndpoint class to set up the binding in the client application.D、Use the DiscoveryProxy class and the EndpointDiscoveryMetadata class to set up the binding in the client application.

You are developing a Windows Communication Foundation (WCF) service. Client applications require reliable sessions to access the service.Users report that they receive ServerTooBusyException errors when their client application tries to establish a session. You need to ensure that the service can handle a minimum of 30 client connection requests. Which ReliableSessionBindingElement property should you configure?()A、MaxRetryCountB、MaxTransferWindowSizeC、MaxPendingChannelsD、InactivityTimeout

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))]

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()]

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?()A、Add the WebInvoke(UriTemplate="/Items/{id}", Method="DELETE") attribute to the operationB、Add the HttpDelete atribute to the operationC、Replace the string parameter with a RemovedActivityAction parameterD、Replace the return type with RemovedActivityAction.

You develop a Windows Communication Foundation (WCF) service that employees use to access bonus information.You define the following service contract. (Line numbers are included for reference only.) 01 [ServiceContract(SessionMode = SessionMode.Required)] 02 public interface IFinancialService 03 { 04 [OperationContract] 05 string Login(int employeeID, string passwordHash); 06 07 [OperationContract] 08 double GetBonus(int month); 09 10 [OperationContract(IsTerminating = true)] 11 void Logout( ); 12 } Client application can invoke methods without logging in. You need to ensure that the client applications invoke Login before invoking any other method. You also need to ensure that client applications cannot consume the service after invoking Logout. Which two action should you perform? ()(Each correct answer presents part of the solution. Choose two.)。A、Replace line 04 with the following code. [OperationContract(IsInitiating = false)]B、Replace line 04 with the following code. [OperationContract(IsInitiating = true, IsTerminating = true)]C、Replace line 07 with the following code. [OperationContract(IsInitiating = false)]D、Replace line 10 with the following code. [OperationContract(IsInitiating = false, IsTerminating = true)]

A Windows Communication Foundation (WCF) service has a callback contract. You are developing a client application that will call this service.You must ensure that the client application can interact with the WCF service. What should you do?()A、On the OperationContractAttribute, set the AsyncPattern property value to true.B、On the OperationContractAttribute, set the ReplyAction property value to the endpoint address of the client.C、On the client, create a proxy derived from DuplexClientBaseTChannel .D、On the client, use GetCallbackChannelT .

You are developing a client application that consumes a Windows Communication Foundation (WCF) service. The operation contract is as follows. [OperationContract] [FaultContract(typeof(SalesFault))] string GetSales(string saleId);() The service configuration file contains the following line in the serviceBehaviors section. A divide-by-zero exception is not being handled by the service. You need to ensure that the exception is caught in the client application. Which type of exception should the client catch?()A、TimeoutExceptionB、FaultExceptionC、DivideByZeroExceptionD、FaultExceptionSalesFault

单选题A Windows Communication Foundation (WCF) service has a callback contract. You are developing a client application that will call this service. You must ensure that the client application can interact with the WCF service. What should you do? ()A On the OperationContractAttribute, set the AsyncPattern property value to True.B On the OperationContractAttribute, set the ReplyAction property value to the endpoint address of the client. For interactive and self-paced preparation of exam 70-513, try our practice exams. Practice exams also include self assessment and reporting features!C On the client, create a proxy derived from DuplexClientBase(Of TChannel).D On the client, use GetCallbackChannel(Of T).