Which two actions should you perform?

You are adding a Windows Communication Foundation (WCF) service to an existing application.
The application is configured as follows. (Line numbers are included for reference only)

01 <configuration>
02 <system.serviceModel>
03 <services>
04 <service name=”Contoso.Sales.Stock.Service”
05 behaviorConfiguration=”MetadataBehavior”>
06 <host>
07 <baseAddresses>
08 <add baseAddress=”http://contosso.com:8080/StockService” />
09 </baseAddresses>
10 </host>
11 </service>
12 </services>
13 <behaviors>
14 <serviceBehaviors>
15 <behavior name=”MetadataBehavior”>
16 </behavior>
17 </serviceBehaviors>
18 </behaviors>
19 …

You need to configure the service to publish the service metadata.
Which two actions should you perform? (Each answer presents part of the solution. Choose two.)

You are adding a Windows Communication Foundation (WCF) service to an existing application.
The application is configured as follows. (Line numbers are included for reference only)

01 <configuration>
02 <system.serviceModel>
03 <services>
04 <service name=”Contoso.Sales.Stock.Service”
05 behaviorConfiguration=”MetadataBehavior”>
06 <host>
07 <baseAddresses>
08 <add baseAddress=”http://contosso.com:8080/StockService” />
09 </baseAddresses>
10 </host>
11 </service>
12 </services>
13 <behaviors>
14 <serviceBehaviors>
15 <behavior name=”MetadataBehavior”>
16 </behavior>
17 </serviceBehaviors>
18 </behaviors>
19 …

You need to configure the service to publish the service metadata.
Which two actions should you perform? (Each answer presents part of the solution. Choose two.)

A.
Add the following XML segment between lines 10 and 11:
<endpoint address=”” binding=”mexHttpBinding” contract=”MetadataExchange” />

B.
Add the following XML segment between lines 10 and 11:
<endpoint address=”” binding=”basicHttpBinding” contract=”MetadataExchange” />

C.
Add the following XML segment between lines 15 and 16:
<serviceDiscovery>
<anouncementEndpoints>
<endpoint address=””/>
</anouncementEndpoints>
</serviceDiscovery>

D.
Add the following XML segment between lines 15 and 16:
<serviceMetadata httpGetEnabled=”true” />

Explanation:
<mexHttpBinding>
Specifies the settings for a binding used for the WS-MetadataExchange (WS-MEX) message exchange over HTTP.
This binding is essentially a WSHttpBinding binding with security disabled. It supports most metadata requests.

<serviceMetadata> Specifies the publication of service metadata and associated information.
httpGetEnabled A Boolean value that specifies whether to publish service metadata for retrieval using an HTTP/Get request. The default is false.

<serviceMetadata>
(http://msdn.microsoft.com/en-us/library/ms731317.aspx)

<mexHttpBinding>
(http://msdn.microsoft.com/en-us/library/aa967390.aspx)



Leave a Reply 1

Your email address will not be published. Required fields are marked *