You are developing a Windows Communication Foundation (WCF) service that will be hosted in Microsoft Internet Information Services (IIS) 7.0.
The service must be hosted in an lIS application named Info. You need to enable this service to be hosted in llS by changing the web.config file.
Which XML segment should you add to the web.config file?
A.
<serviceHostingEnvironment>
<senviceActivations>
<add relativeAddress=”Info.svc” service=”Info” />
</serviceActivations>
</serviceHostingEnvironment>
B.
<serviceHostingEnvironment>
<serviceActivations>
<add relativeAddress=”Info” service=”Info.svc” />
</serviceActivations>
</serviceHostingEnvironment>
C.
<serviceHostingEnvironment>
<transportConfigurationTypes>
<add name=”Info” transportConfigurationType=”Info.svc”/>
</transportConfigurationTypes>
</serviceHostingEnvironment>
D.
<serviceHostingEnvironment>
<transportConfigurationTypes>
<add name=”Info.svc” transportConfigurationType=”FileNotRequired” />
</transportConfigurationTypes>
<serviceHostingEnvironment>
Explanation:
<serviceHostingEnvironment>
<serviceActivations>
<add relativeAddress=”MyServiceAddress” service=”Service” factory=MyServiceHostFactory/>
</serviceActivations>
</serviceHostingEnvironment>When using configuration-based activation, inline code in .svc files is not supported.
The relativeAddress attribute must be set to a relative address such as <sub-directory>/service.svc or ~/<sub-directory/service.svc.
A configuration exception is thrown if you register a relative address that does not have a known extension associated with WCF.
The relative address specified is relative to the root of the virtual application.
Due to the hierarchical model of configuration, the registered relative addresses at machine and site level are inherited by virtual applications.
Registrations in a configuration file take precedence over settings in a .svc, .xamlx, .xoml, or other file.
Any \ (backslashes) in a URI sent to IIS/WAS are automatically converted to a / (forward slash).
If a relative address is added that contains a \ and you send IIS a URI that uses the relative address, the backslash is converted to a forward
slash and IIS cannot match it to the relative address. IIS sends out trace information that indicates that there are no matches found.Configuration-Based Activation
(http://msdn.microsoft.com/en-us/library/dd807499.aspx)
A