单项选择题
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
{
...
}
The configuration file contains the following lines.
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 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. -
单项选择题
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 theelement from the service back to the client.
D. Update the service reference. -
单项选择题
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.
B.
C.
D.
