Wcf ssl

Discussion in 'ASP.NET WebServices' started by Bernybon, Jan 22, 2013.

  1. I installed in SLL Certificate on my DiscountASP website.
    Now when I call the WCF service, nothing happen.
    I configured the web.config as such:

    Code:
    <?xml version="1.0"?>
    
    <configuration>
    
      <system.diagnostics>
        <sources>
          <source name="System.ServiceModel"
                  switchValue="Information, ActivityTracing"
                  propagateActivity="true">
            <listeners>
              <add name="traceListener"
                  type="System.Diagnostics.XmlWriterTraceListener"
                  initializeData="c:\trace.svclog"  />
            </listeners>
          </source>
        </sources>
      </system.diagnostics>
      
        <connectionStrings>
            <add name="DatabaseConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True"
                providerName="System.Data.SqlClient" />
            <add name="SQL2008R2_909240_lesartsConnectionString" connectionString="Data Source=sql2k805.discountasp.net;Initial Catalog=SQL2008R2_909240_lesarts;Persist Security Info=True;User ID=**************;Password=************"
                providerName="System.Data.SqlClient" />
        </connectionStrings>
        <system.web>
            <compilation debug="true" targetFramework="4.0" />
        </system.web>
    
      <system.web.extensions>
        <scripting>
          <webServices>
            <authenticationService enabled="true"
               requireSSL = "true"/>
          </webServices>
        </scripting>
      </system.web.extensions>
    
      <system.serviceModel>
            <behaviors>
                <serviceBehaviors>
                    <behavior name="serviceBehavior">
                        <serviceMetadata httpGetEnabled="true" />
                        <dataContractSerializer maxItemsInObjectGraph="2147483647" />
                        <serviceDebug includeExceptionDetailInFaults="true" />
                    </behavior>
                    <behavior name="">
                        <serviceMetadata httpGetEnabled="true" />
                        <serviceDebug includeExceptionDetailInFaults="false" />
                    </behavior>
                </serviceBehaviors>
            </behaviors>
            <bindings>
                <basicHttpBinding>
                    <binding name="streamForVideo" hostNameComparisonMode="StrongWildcard"
                        maxBufferSize="2147483647" maxBufferPoolSize="2147483647"
                        maxReceivedMessageSize="2147483647" transferMode="Streamed">
                        <readerQuotas maxDepth="64" maxStringContentLength="2147483647"
                            maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                      <security mode="Transport" >
                      </security>
                    </binding>
                </basicHttpBinding>
                <customBinding>
                    <binding name="LesArts.Web.SessionService.customBinding0">
                        <binaryMessageEncoding />
                        <httpTransport />
                    </binding>
                </customBinding>
            </bindings>
            <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
                multipleSiteBindingsEnabled="true" />
            <services>
                <service behaviorConfiguration="serviceBehavior" name="LesArts.Web.Service">
                    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="streamForVideo"
                        contract="LesArts.Web.Service" />
                    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
                </service>
                <service name="LesArts.Web.SessionService">
                    <endpoint address="" binding="customBinding" bindingConfiguration="LesArts.Web.SessionService.customBinding0"
                        contract="LesArts.Web.SessionService" />
                    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
                </service>
            </services>
        </system.serviceModel>
    </configuration>
    

    I will also have to secure my connectionstring
     
  2. Have you tried using Chrome/Developer Tools to see what calls maybe failing on your site? Can you give us a URL to look at to see for ourselves to get a better understanding of it?
     
  3. To add to Raymond's post, sometimes web services need to have the certificate installed on the server made available to them specifically.

    So we really need to have a URL where we can see the error (or lack of one) in order to get an idea of what's going on.
     

Share This Page