RE: WSE 2.0 SP2 - TimeZone, "Message Expired"

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: [MSFT] (lukezhan_at_online.microsoft.com)
Date: 01/18/05


Date: Tue, 18 Jan 2005 08:17:18 GMT

Hello,

I found a simaliar issue which was resolved by following solution:

1. Timestamp.TtlInSeconds property. This gets or sets the number of seconds
after creation that a message is valid. You were setting this in your
client side code to either 0,1, or -1. This means that when WSE will
compare the local server time to the expiration time. When you set this to
-1, you’ll see that the <expiration> tag is not included in the soap
envelope however it still fails because of item #3 below

2. <ttlInSeconds> element - This tag you can add to a configuration file to
specify how long an issued SecurityContextToken security token is valid.

3. <timeToleranceInSeconds> element - This is what you need to resolve your
issue. This value specifies the time buffer used by WSE when it compares
the timestamps for a SOAP message. You use the <timeToleranceInSeconds>
element when there is a clock difference between the SOAP message sender
and receiver. WSE uses the <timeToleranceInSeconds> element when it
compares the current time against the expiration time for all security
tokens and against the creation time for post-dated security tokens. The
default time buffer is five minutes. That is, WSE uses the
<timeToleranceInSeconds> element to determine the time buffer of when a
security token or SOAP message is valid.

Solution
=====================
To resolve your issue we simply needed to add this <timeToleranceInSeconds>
element to the configuration file of the client and the web service. For
the web service you simply modify the web.config file. Here is the relevant
change that I made to your web.config file that you sent as the repro.

  <microsoft.web.services2>
    <diagnostics />
    <security>
                <timeToleranceInSeconds>660</timeToleranceInSeconds> <!-- 660 = 11
minutes -->
    </security>
    <tokenIssuer>
      <autoIssueSecurityContextToken enabled="false" />
      <ttlInSeconds>0</ttlInSeconds>
    </tokenIssuer>
  </microsoft.web.services2>

This would resolve any errors thrown at the server where the client
expiration (or creation) times are already surpassed. But then you have to
add this configuration to the client application as the server is sending
back timestamps of when the messages expire back to the client. For the
client application you have to add a app.config file that has the following
data:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="microsoft.web.services2"
type="Microsoft.Web.Services2.Configuration.WebServicesConfiguration,
Microsoft.Web.Services2, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" />
  </configSections>
  <microsoft.web.services2>
    <diagnostics>
      <trace enabled="true" input="InputTrace.webinfo"
output="OutputTrace.webinfo"
/>
    </diagnostics>
   <security>
                <timeToleranceInSeconds>660</timeToleranceInSeconds>
        </security>
  </microsoft.web.services2>
</configuration>

You can actually use the WSE Configuration Tool to automatically create
this app.config file and add it to your client solution files. I recommend
reading up on the WseConfigEditor2.exe tool as documented in the WSE
documentation.

Hope this help,

Luke



Relevant Pages

  • Re: Client End Firewalls
    ... it doesn't matter if the email client can't be tricked when the ... control such things on a Windows 98 box. ... > than getting the client firewall properly configured. ... > additional costs for configuration and configuration-changes? ...
    (Security-Basics)
  • RE: Run VBA Code from new mail message on standard toolbar
    ... The resolve address issue relates my requirement to be able to call the ... for the same client and I may not know what the Project number is. ... Dim strEmail As String ... Dim objRecipient As Recipient ...
    (microsoft.public.outlook.program_vba)
  • RE: Run VBA Code from new mail message on standard toolbar
    ... The resolve address issue relates my requirement to be able to call the ... for the same client and I may not know what the Project number is. ... Dim strEmail As String ... Dim objRecipient As Recipient ...
    (microsoft.public.outlook.program_vba)
  • Re: Overwhelmed by choices of Design Patterns
    ... For this app, the configuration looked something ... --- the client of the configurator most query the data out of the ... similarity from the adapter interface and the adaptee interface .. ... suddenly looks a lot like Strategy Pattern? ...
    (comp.object)
  • RE: two subnets on my sbs server
    ... The client computer is attached to a router that also provides DHCP ... Server settings, so when I updated the lmhost file on the ... What the language version of your SBS server is? ...
    (microsoft.public.windows.server.sbs)