3
votes

I have a WCF web service in IIS 6 and trying to get it to work over SSL. When I call the service I get the following error:

The message could not be processed. This is most likely because the action 'http://tempuri.org/IARPolicyComposer/GetTemplatesList' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.

Here is the service config:

<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<bindings>
  <wsHttpBinding>
    <binding name="WSHttpBinding_IARPolicyComposer">
      <security mode="Transport">
      </security>
    </binding>
  </wsHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="PolicyComposer.ARPolicyComposerBehavior" name="PolicyComposer.ARPolicyComposer">
            <endpoint address="" binding="wsHttpBinding" contract="PolicyComposer.IARPolicyComposer">
            </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services> 
<behaviors>
<serviceBehaviors>
<behavior name="PolicyComposer.ARPolicyComposerBehavior">
    <serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<behavior name="">
 <serviceMetadata httpGetEnabled="true" />
 <serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>

Client's config:

  <wsHttpBinding>
    <binding name="WSHttpBinding_IARPolicyComposer" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
      <security mode="Transport">
      </security>
    </binding>
  </wsHttpBinding>

Both service and client are on the same domain.

1
At first I would ignore the comments about the Receive timeout, its more likely to have to do with security settings. - Avada Kedavra
Without ssl it is working? If never tried make it work without ssl first... - Yves M.
The following error is logged in the log file and I see that my website doesn't have a certificate and 'Requires SSL' is also not checked: Could not find a base address that matches scheme https for the endpoint with binding WSHttpBinding. Registered base address schemes are [http].. - Evan
It is working in another environment that doesn't utilize ssl - Evan

1 Answers

3
votes

You have

<serviceMetadata httpGetEnabled="true" /> 

Shouldn't it be

<serviceMetadata httpsGetEnabled="true" />

Mind the s in httpsGetEnabled...

And if you ask me this part can be removed since it is not used by an endpoint...

<behavior name="">  
  <serviceMetadata httpGetEnabled="true" />  
  <serviceDebug includeExceptionDetailInFaults="false" /> 
</behavior>

How about changing the mex binding to

binding="mexHttpsBinding"