Я применил ssl к своему домену, но после этого мой wcf перестал работать.Я пытался добавить mexhttpsmapping
, но у меня это не сработало.
Я использую wcf для извлечения данных в формате json.Мой web.config:
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="false"
multipleSiteBindingsEnabled="true" />
<bindings>
<webHttpBinding>
<binding name="restLargeBinding" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647" maxBufferSize="2147483647"
transferMode="Streamed">
<readerQuotas maxStringContentLength="2147483647"/>
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="myWebEndPointBehaviour">
<webHttp automaticFormatSelectionEnabled="true"
defaultBodyStyle="Bare" defaultOutgoingResponseFormat="Json"
helpEnabled="true"/>
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="myServiceBehaviour">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="DemoWCFServiceForVision.Service1"
behaviorConfiguration="myServiceBehaviour">
<endpoint address="" contract="DemoWCFServiceForVision.IService1"
binding="webHttpBinding" bindingConfiguration="restLargeBinding"
behaviorConfiguration="myWebEndPointBehaviour"/>
<endpoint address="mex" contract="DemoWCFServiceForVision.IService1"
binding="mexHttpBinding"/>
</service>
</services>
<protocolMapping>
<add binding="basicHttpBinding" scheme="https"/>
</protocolMapping>
</system.serviceModel>
<system.webServer>
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Permanent"
url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>
<modules runAllManagedModulesForAllRequests="true"/>
<directoryBrowse enabled="true"/>
</system.webServer>