Click here to Skip to main content
15,867,895 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i am getting 404 error for https URL related to WCF Service. I am using asp.net with c# and framework 4.6.1. I am using POST Method. I am having no issue if the URL is of http type. I am able to browse the URL with both http and https.
I am sharing the System.ServiceModel Tag area in the web.config file. kindly update on this at the earliest

What I have tried:

My web.config file is as below:
<system.serviceModel>
    <services>
      <service name="DDSWebService.DDS_IDAM" behaviorConfiguration="ServiceBehaviour">
        <endpoint address="" binding="webHttpBinding" contract="DDSWebService.IDDS_IDAM" behaviorConfiguration="web"></endpoint>
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
            <message clientCredentialType="UserName" algorithmSuite="Default"/>
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost:58685/BankPortalService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService" contract="BankPortalService.IService" name="BasicHttpBinding_IService"/>
    </client>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehaviour">
          <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="web">
          <webHttp />
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <protocolMapping>
      <add binding="webHttpBinding" scheme="https" />
    </protocolMapping>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
Posted
Comments
Richard Deeming 16-Sep-21 4:05am    
All of your bindings specify http: addresses. But I'm not sure what effect those have (if any) when you host your service in IIS.
ranio 16-Sep-21 5:40am    
I updated with https binding but i am getting 500 internal error . so what can i do
<system.servicemodel>
<services>
<service name="DDSWebService.DDS_IDAM" behaviorconfiguration="ServiceBehaviour">
<endpoint address="" binding="webHttpBinding" contract="DDSWebService.IDDS_IDAM" behaviorconfiguration="web">
<host>
<baseaddresses>
<add baseaddress="http://localhost/">




<bindings>
<basichttpbinding>
<binding name="BasicHttpBinding_IService" closetimeout="00:01:00" opentimeout="00:01:00" receivetimeout="00:10:00" sendtimeout="00:01:00" allowcookies="false" bypassproxyonlocal="false" hostnamecomparisonmode="StrongWildcard" maxbuffersize="65536" maxbufferpoolsize="524288" maxreceivedmessagesize="65536" messageencoding="Text" textencoding="utf-8" transfermode="Buffered" usedefaultwebproxy="true">
<readerquotas maxdepth="32" maxstringcontentlength="8192" maxarraylength="16384" maxbytesperread="4096" maxnametablecharcount="16384">
<security mode="None">
<transport clientcredentialtype="None" proxycredentialtype="None" realm=""> <message clientcredentialtype="UserName" algorithmsuite="Default">




<client>
<endpoint address="http://localhost:58685/BankPortalService.svc" binding="basicHttpBinding" bindingconfiguration="BasicHttpBinding_IService" contract="BankPortalService.IService" name="BasicHttpBinding_IService">

<behaviors>
<servicebehaviors>
<behavior name="ServiceBehaviour">

<servicemetadata httpsgetenabled="true">

<servicedebug includeexceptiondetailinfaults="true">


<endpointbehaviors>
<behavior name="web">
<webhttp>



<protocolmapping>
<add binding="webHttpBinding" scheme="https">

<servicehostingenvironment aspnetcompatibilityenabled="false" multiplesitebindingsenabled="true">

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900