Created
February 14, 2013 01:10
-
-
Save terrancesnyder/4949866 to your computer and use it in GitHub Desktop.
Example WCF config for content type negotation with JSON/XML AND SOAP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<configuration> | |
<system.web> | |
<compilation debug="true" targetFramework="4.0" /> | |
</system.web> | |
<system.serviceModel> | |
<services> | |
<service name="Service.HelloWorldService" behaviorConfiguration="wsdl"> | |
<endpoint address="soap" binding="basicHttpBinding" contract="Service.IHelloWorldService" /> | |
<endpoint address="xml" binding="webHttpBinding" behaviorConfiguration="restBehavior" contract="Service.IHelloWorldServicee" /> | |
</service> | |
</services> | |
<behaviors> | |
<serviceBehaviors> | |
<behavior name="wsdl" > | |
<serviceMetadata httpGetEnabled="true" /> <!-- because we want to have a wsdl --> | |
<serviceDebug includeExceptionDetailInFaults="true" /> <!-- because we want to know what went wrong --> | |
</behavior> | |
</serviceBehaviors> | |
<endpointBehaviors> | |
<behavior name="restBehavior"> | |
<!-- content type negotation --> | |
<webHttp automaticFormatSelectionEnabled="true" helpEnabled="true" faultExceptionEnabled="true"/> | |
</behavior> | |
</endpointBehaviors> | |
</behaviors> | |
</system.serviceModel> | |
</configuration> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment