I figured it out with the help of platform developer.
When you are trying to access the REST API over HTTPS site, there are a couple of updates/additions that need to be made in web.config of your website that's SSL enabled versus the one that's not SSL enabled.
- Under section <swaggerwcf></swaggerwcf>, make sure everything all the $$$ entries are set according to your project
<settings>
<setting name="InfoDescription" value="$$$Description$$$"/>
<setting name="InfoVersion" value="1.0"/>
<setting name="InfoTermsOfService" value="$$$TermsOfService$$$"/>
<setting name="InfoTitle" value="$$$ProjectTitle$$$"/>
<setting name="InfoContactName" value="$$$DeveloperName$$$"/>
<setting name="InfoContactUrl" value="$$$WebsiteURL$$$"/>
<setting name="InfoContactEmail" value="$$$DeveloperEmail$$$"/>
<setting name="InfoLicenseUrl" value="http://www.apache.org/licenses/LICENSE-2.0.html"/>
<setting name="InfoLicenseName" value="Apache 2.0"/>
<setting name="Host" value="$$$yourwebsite.com$$$"/>
<setting name="BasePath" value="/rest"/>
<setting name="Schemes" value="https"/>
</settings>
- Under section <bindings></bindings>, compare and update the binding
<webhttpbinding>
<binding name="restWebHttpBinding" contenttypemapper="EnrollmentPortal.Service.RawWebContentTypeMapper, HollyAdams.EnrollmentPortal-Project, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<security mode="Transport"/>
</binding>
</webhttpbinding>
- Under section <servicebehaviors></servicebehaviors>, compare and update behaviors
<behavior>
<servicemetadata httpsgetenabled="True"/>
<servicedebug includeexceptiondetailinfaults="False"/>
</behavior>
<behavior name="GTCServiceBehavior">
<servicemetadata httpsgetenabled="true"/>
<wcfmessageinspection/>
<servicedebug includeexceptiondetailinfaults="False"/>
</behavior>
- Add new section (below section <extensions></extensions>)
<protocolmapping>
<add scheme="http" binding="webHttpBinding" bindingconfiguration="restWebHttpBinding"/>
<add scheme="https" binding="webHttpBinding" bindingconfiguration="restWebHttpBinding"/>
</protocolmapping>
Once the above changes are done, perform IIS reset and test the api again.
answered
15 Jul '20, 11:34
Nitin Chhabra
101●22●30●34
accept rate:
33%