exam questions

Exam 70-487 All Questions

View all questions & answers for the 70-487 exam

Exam 70-487 topic 1 question 46 discussion

Actual exam question from Microsoft's 70-487
Question #: 46
Topic #: 1
[All 70-487 Questions]

DRAG DROP -
You are developing a WCF service.
You need to configure the web.config file to ensure that metadata is exposed only via the MEX protocol.
You have the following markup:

Which XML elements should you include in Target 1, Target 2, Target 3 and Target 4 to complete the markup? (To answer, drag the appropriate XML elements to the correct targets in the answer area/ Each XML element 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.)
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Target 1: mexHttpBinding -

Target 2: IMetadataExchange -
Example of valid endpoint definition for the MEX protocol:
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange"/>

Target 3: httpGetEnabled -

Target 4: true -
Cervice behaviors are configured for the default endpoints by using anonymous <behavior> sections within <serviceBehaviors> sections. Any unnamed
<behavior> elements within <serviceBehaviors> are used to configure service behaviors. For example, the following configuration file enables service metadata publishing for all services within the host.
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="True"/>
</behavior>
</serviceBehaviors>
</behaviors> <!-- No <service> tag is necessary. Default endpoints are added to the service -->
<!-- The service behavior with name="" is picked up by the service -->
</system.serviceModel>
References:
https://docs.microsoft.com/en-us/dotnet/framework/wcf/simplified-configuration

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
MaverickCalibre
Highly Voted 5 years, 4 months ago
We need to configure the web.config file to ensure that metadata is exposed only via the MEX protocol, so httpGetEnabled should be set to false so metadata is accessible only through mex protocol.
upvoted 13 times
LeonWang
5 years, 3 months ago
Agree. http://blogs.microsoft.co.il/idof/2011/08/10/wsdl-vs-mex-knockout-or-tie/
upvoted 4 times
...
Dreamchaser1980
4 years, 7 months ago
I Agree, If you set httpGetEnabled="false" then the metadata cannot be seen in the browser. MEX endpoints are special endpoints that allow clients to receive the service’s metadata by using SOAP messages instead of http get requests. https://stackoverflow.com/questions/7285717/why-do-i-need-both-mex-endpoint-and-httpgetenable
upvoted 3 times
...
...
founderDev
Highly Voted 5 years, 2 months ago
Correct answer is : mexHttpBinding, MetadataExchange, httpGetEnabled, false
upvoted 11 times
KevinVording
4 years, 7 months ago
https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/how-to-publish-metadata-for-a-service-using-a-configuration-file?redirectedfrom=MSDN This suggests httpGetEnabled, true
upvoted 1 times
piedro
4 years, 5 months ago
The requirement is "ensure that metadata is exposed only via the MEX protocol." Why should you set httpGetEnabled = true ? MEX != HTTP
upvoted 1 times
...
...
...
EltonCostaBR
Most Recent 4 years, 4 months ago
It is correct. https://docs.microsoft.com/en-us/dotnet/framework/wcf/samples/metadata-publishing-behavior
upvoted 1 times
...
ShahAli
4 years, 10 months ago
<system.serviceModel> <behaviors> <serviceBehaviors> <behavior name="MyServiceBehavior"> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="false" /> </behavior> </serviceBehaviors> </behaviors> <bindings> <basicHttpBinding> <binding name=MyBindingConfig" maxBufferSize="100" maxReceiveBufferSize="100" /> </basicHttpBinding> </bindings> <services> <service behaviorConfiguration="MyServiceBehavior" name="MyService"> <endpoint address="" binding="basicHttpBinding" contract="ICalculator" bindingConfiguration="MyBindingConfig" /> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> </service> </services> </system.serviceModel>
upvoted 3 times
...
[Removed]
5 years, 3 months ago
https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/how-to-publish-metadata-for-a-service-using-a-configuration-file?redirectedfrom=MSDN
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago