Reputation: 937
<system.serviceModel>
<client>
<endpoint address=".../ConnectService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IConnectService"
contract="TestApp.Services.IConnectService" name="BasicHttpBinding_IConnectService" />
</client>
<behaviors>
<serviceBehaviors>
<behavior name="ConnectServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="ConnectEndPointBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
<services>
<service behaviorConfiguration="ConnectServiceBehavior" name="TestApp.Services.ConnectService">
<endpoint address="" binding="basicHttpBinding" contract="TestApp.Services.IConnectService" behaviorConfiguration="ConnectEndPointBehavior"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
I am getting
The endpoint at '.../ConnectService.svc' does not have a Binding with the None MessageVersion. 'System.ServiceModel.Description.WebScriptEnablingBehavior' is only intended for use with WebHttpBinding or similar bindings.
server error. Any suggestions?
Upvotes: 0
Views: 4473
Reputation: 937
here I am using "enableWebScript" in the endpointBehaviors (REST) & in the service endpoint basicHttpBinding(SOAP). Hence I was getting this exception. so the correct way will be
<services>
<service behaviorConfiguration="ConnectServiceBehavior" name="TestApp.Services.ConnectService">
<endpoint address="" binding="webHttpBinding" contract="TestApp.Services.IConnectService" behaviorConfiguration="ConnectEndPointBehavior"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
Upvotes: 1