Groups | Blog | Home
all groups > dotnet web services enhancements > december 2004 >

dotnet web services enhancements : Need for programmatic config:timeToleranceInSeconds, MaxRequestLen


drkraus
12/7/2004 4:19:07 PM
In another thread I have documented my struggle and success at finding a way
to programmatically alter the read only property MaxRequestLengthInBytes
(Microsoft.Web.Services2.Configuration.WebServicesConfiguration.MessagingConfiguration.MaxRequestLengthInBytes)
using reflection to access a private data member, in order to allow larger
size DIME attachements.

Now I am trying to figure out how to set timeToleranceInSeconds. It seems
that setting wsproxy.RequestSoapContext.Security.Timestamp.TtlInSeconds sets
the defaultTtlInSeconds config parm, but that there isn't a way, that I have
found to do the same for timeToleranceInSeconds. Clock drift of more than 5
minutes isn't too uncommon, so I was thinking of uping the value to avoid
message expiration problems.

Anyway, the common thread here is that, yes, this can be done in the
web.config and the app.config files to solve these problems, but in my case,
when the client is an Excel add-in, creating an excel.exe.config file, or
altering machine.config isn't kosher since other add-ins or client users may
want different settings.

So I have a specific questions and a general one for any Microsoft guru's
out there.
1. Specific: Is there a way to set timeToleranceInSeconds programmatically?
If not directly, then via reflection (the class location of the property
would help me).

2. Does it make sense to request a change from Microsoft to enable better
programmatic manipulation of these kinds of config parameters?

thanks, Dave
danro NO[at]SPAM microsoft.com
12/8/2004 12:56:36 AM
------=_NextPart_0001_E7EC2597
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi Dave,

Interesting requirements. Would a per-site/config value for these make
sense? I think the thinking right now is that these are administrator
and/or business policy type settings that you may not want a programmer or
application to be able to override.

Thoughts?

Dan Rogers
Microsoft Corporation
--------------------
Thread-Topic: Need for programmatic config:timeToleranceInSeconds,
MaxRequestLen
thread-index: AcTcu4f8VZA0MUw9QCyRyEgzmboVQA==
X-WBNR-Posting-Host: 4.43.44.35
From: "=?Utf-8?B?ZHJrcmF1cw==?=" <drkraus@nospam.nospam>
Subject: Need for programmatic config:timeToleranceInSeconds, MaxRequestLen
Date: Tue, 7 Dec 2004 16:19:07 -0800
Lines: 30
Message-ID: <30AB465D-A703-4943-B259-C588C7CAE6BC@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices.enhancements
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices.enhancements:5076
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices.enhancements

In another thread I have documented my struggle and success at finding a
way
to programmatically alter the read only property MaxRequestLengthInBytes
(Microsoft.Web.Services2.Configuration.WebServicesConfiguration.MessagingCon
figuration.MaxRequestLengthInBytes)
using reflection to access a private data member, in order to allow larger
size DIME attachements.

Now I am trying to figure out how to set timeToleranceInSeconds. It seems
that setting wsproxy.RequestSoapContext.Security.Timestamp.TtlInSeconds
sets
the defaultTtlInSeconds config parm, but that there isn't a way, that I
have
found to do the same for timeToleranceInSeconds. Clock drift of more than 5
minutes isn't too uncommon, so I was thinking of uping the value to avoid
message expiration problems.

Anyway, the common thread here is that, yes, this can be done in the
web.config and the app.config files to solve these problems, but in my
case,
when the client is an Excel add-in, creating an excel.exe.config file, or
altering machine.config isn't kosher since other add-ins or client users
may
want different settings.

So I have a specific questions and a general one for any Microsoft guru's
out there.
1. Specific: Is there a way to set timeToleranceInSeconds programmatically?
If not directly, then via reflection (the class location of the property
would help me).

2. Does it make sense to request a change from Microsoft to enable better
programmatic manipulation of these kinds of config parameters?

thanks, Dave


------=_NextPart_0001_E7EC2597
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20 Hi Dave,
\par
\par Interesting requirements. Would a per-site/config value for these make sense? I think the thinking right now is that these are administrator and/or business policy type settings that you may not want a programmer or application to be able to override.
\par
\par Thoughts?
\par
\par Dan Rogers
\par Microsoft Corporation
\par \pard\li720 --------------------
\par Thread-Topic: Need for programmatic config:timeToleranceInSeconds, MaxRequestLen
\par thread-index: AcTcu4f8VZA0MUw9QCyRyEgzmboVQA==
\par X-WBNR-Posting-Host: 4.43.44.35
\par From: "=?Utf-8?B?ZHJrcmF1cw==?=" <drkraus@nospam.nospam>
\par Subject: Need for programmatic config:timeToleranceInSeconds, MaxRequestLen
\par Date: Tue, 7 Dec 2004 16:19:07 -0800
\par Lines: 30
\par Message-ID: <30AB465D-A703-4943-B259-C588C7CAE6BC@microsoft.com>
\par MIME-Version: 1.0
\par Content-Type: text/plain;
\par \tab charset="Utf-8"
\par Content-Transfer-Encoding: 7bit
\par X-Newsreader: Microsoft CDO for Windows 2000
\par Content-Class: urn:content-classes:message
\par Importance: normal
\par Priority: normal
\par X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
\par Newsgroups: microsoft.public.dotnet.framework.webservices.enhancements
\par NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
\par Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
\par Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.webservices.enhancements:5076
\par X-Tomcat-NG: microsoft.public.dotnet.framework.webservices.enhancements
\par
\par In another thread I have documented my struggle and success at finding a way
\par to programmatically alter the read only property MaxRequestLengthInBytes
\par (Microsoft.Web.Services2.Configuration.WebServicesConfiguration.MessagingConfiguration.MaxRequestLengthInBytes)
\par using reflection to access a private data member, in order to allow larger
\par size DIME attachements.
\par
\par Now I am trying to figure out how to set timeToleranceInSeconds. It seems
\par that setting wsproxy.RequestSoapContext.Security.Timestamp.TtlInSeconds sets
\par the defaultTtlInSeconds config parm, but that there isn't a way, that I have
\par found to do the same for timeToleranceInSeconds. Clock drift of more than 5
\par minutes isn't too uncommon, so I was thinking of uping the value to avoid
\par message expiration problems.
\par
\par Anyway, the common thread here is that, yes, this can be done in the
\par web.config and the app.config files to solve these problems, but in my case,
\par when the client is an Excel add-in, creating an excel.exe.config file, or
\par altering machine.config isn't kosher since other add-ins or client users may
\par want different settings.
\par
\par So I have a specific questions and a general one for any Microsoft guru's
\par out there.
\par 1. Specific: Is there a way to set timeToleranceInSeconds programmatically?
\par If not directly, then via reflection (the class location of the property
\par would help me).
\par
\par 2. Does it make sense to request a change from Microsoft to enable better
\par programmatic manipulation of these kinds of config parameters?
\par
\par thanks, Dave
\par
\par \pard
\par
\par }
------=_NextPart_0001_E7EC2597--
drkraus
12/8/2004 9:23:03 AM
Hi Dan,

Well, it did bother me a bit that I could override a read-only property
using reflection, but only in principle.

A little more background:
In reality, I would have been satisfied if I could have created an
application config file for our client DLL, that is invoked as an add-in to
Excel. Our client group attempted this without success. They ended up
creating a config file (ie. appname.dll.config) that they specifically query
to pick up their application settings. Any non-application settings that are
present are ignored at DLL load time, and would have to be programmtically
set as I have described. The next alternative was to create an
Excel.exe.config file, which is unacceptable.

I have been assuming that when a setting like timeToleranceInSeconds is
configured in a app.config file, that this setting is specific to that
application only. The same goes for any programmatic setting of the same
property by a client. If this is true, I am not sure where the concern lies.
We are just talking about how the property is set. Now, if it is easier to
compromise/spoof an application program, than it is to compromise/spoof a
config file, then I might see a problem. This would then lead me to believe
that I may have indeed "hacked into" the MaxRequestLengthInBytes property
using reflection.

Finally, even though there is only one of our clients per box, a per-site
config setting would not allow other non-related applications to use other
values.

thanks, Dave



[quoted text, click to view]
danro NO[at]SPAM microsoft.com
12/10/2004 6:46:54 PM
------=_NextPart_0001_F60CE20D
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi Dave,

Thanks for explaining your thoughts on this. I think I agree. In your
case, you are doing something a bit unexpected - making excel take an
in-proc control over managed code. At some point, this won't be
un-conventional - after such point when Excel has been redone in managed
code, for instance.

I wish I had an easy answer for you. You probably have discovered that
using reflection may let you do the over-ride on a new instance of the
class - but it doesn't update the one that is being used by the CLR to
manage the application. So the hacking concerns there aren't as serious.

Do you really need to set this on a per application basis? Why? Wouldn't
it be better to handle time-differences (if you need message time-out) at
the application level?

Dan
--------------------
Thread-Topic: Need for programmatic config:timeToleranceInSeconds, MaxReques
thread-index: AcTdSpMp89gsN2HJSM2k0qyloyGq7Q==
X-WBNR-Posting-Host: 204.210.55.215
From: "=?Utf-8?B?ZHJrcmF1cw==?=" <drkraus@nospam.nospam>
References: <30AB465D-A703-4943-B259-C588C7CAE6BC@microsoft.com>
<EnnNGDM3EHA.3984@cpmsftngxa10.phx.gbl>
Subject: RE: Need for programmatic config:timeToleranceInSeconds, MaxReques
Date: Wed, 8 Dec 2004 09:23:03 -0800
Lines: 109
Message-ID: <1244B818-C97A-4AC0-B436-18A6C51C7AB9@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices.enhancements
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA0
3.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices.enhancements:5086
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices.enhancements

Hi Dan,

Well, it did bother me a bit that I could override a read-only property
using reflection, but only in principle.

A little more background:
In reality, I would have been satisfied if I could have created an
application config file for our client DLL, that is invoked as an add-in to
Excel. Our client group attempted this without success. They ended up
creating a config file (ie. appname.dll.config) that they specifically
query
to pick up their application settings. Any non-application settings that
are
present are ignored at DLL load time, and would have to be programmtically
set as I have described. The next alternative was to create an
Excel.exe.config file, which is unacceptable.

I have been assuming that when a setting like timeToleranceInSeconds is
configured in a app.config file, that this setting is specific to that
application only. The same goes for any programmatic setting of the same
property by a client. If this is true, I am not sure where the concern
lies.
We are just talking about how the property is set. Now, if it is easier to
compromise/spoof an application program, than it is to compromise/spoof a
config file, then I might see a problem. This would then lead me to believe
that I may have indeed "hacked into" the MaxRequestLengthInBytes property
using reflection.

Finally, even though there is only one of our clients per box, a per-site
config setting would not allow other non-related applications to use other
values.

thanks, Dave



[quoted text, click to view]

------=_NextPart_0001_F60CE20D
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
drkraus
12/13/2004 10:29:03 AM
Dan.

I am not sure I understand your question concerning setting timetolerance at
the application level. I am requesting the ability to set these kinds of
values programmtically, or via an application config file associated with a
DLL. This is the same as setting at the application level, so I don't
understand your distinction.

Also, I used reflection to set the MaxRequestBytesInLength read only
property of the active configuration, not my own instance. It would do me no
good to create a configuration instance myself because I didn't know how to
make it active, in the sense that it actually affected behavior of .NET.

Dave

[quoted text, click to view]
AddThis Social Bookmark Button