2 // TimestampOutputFilter.cs: Timestamp SOAP Output Filter
5 // Sebastien Pouliot (spouliot@motus.com)
7 // (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
9 // Licensed under MIT X11 (see LICENSE) with this specific addition:
11 // “This source code may incorporate intellectual property owned by Microsoft
12 // Corporation. Our provision of this source code does not include any licenses
13 // or any other rights to you under any Microsoft intellectual property. If you
14 // would like a license from Microsoft (e.g. rebrand, redistribute), you need
15 // to contact Microsoft directly.”
21 namespace Microsoft
.Web
.Services
.Timestamp
{
23 public class TimestampOutputFilter
: SoapOutputFilter
{
25 public TimestampOutputFilter () {}
27 public override void ProcessMessage (SoapEnvelope envelope
)
30 throw new ArgumentNullException ("envelope");
33 envelope
.Context
.Timestamp
.SetTimestamp (DateTime
.UtcNow
);
34 XmlElement xel
= envelope
.Context
.Timestamp
.GetXml (envelope
);
35 if (envelope
.Header
== null) {
36 XmlElement header
= envelope
.CreateHeader ();
37 envelope
.Envelope
.PrependChild (xel
);
39 envelope
.Header
.AppendChild (xel
);