473,327 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

global paremeters in a WS??

I have several sets of WS. The application making requests to these services
must authenticate to the service by sending a UserName and Password

I wanted to set it up so that the parms were based at the WS level at the
time the application created an instance of the service. For example:

WebReference.ServiceName myService = new WebReference.ServiceName
("JP","password");
if this returns a 'ok' status then the app can use the methods in the service

from this point on, the person can access any method in the service

string Name = myService.GetName("smith");

Basically I want to validate user credentials without having to pass the
username and password as parameters to every method in the service. I only
need to validate once.

I tried specifying the parms at the class level in the WS, but they wont
show up in the intelli-sense when I’m creating an instance.

How can I accomplish this?
--
JP
..NET Software Developer
Feb 28 '07 #1
1 953
Here's a basic strategy approach.

1. Maintain a cache of authenticated sessions on the Server.
http://msdn2.microsoft.com/en-us/library/6hbbsfk6.aspx
2. Once a client authenticates, slip an entry into the cache and send back a
key value (GUID) which can be used to look up that entry in the cache.
3. On each successive method call, the client submits the key which was
received at the time of the successful login.

You need to decide what is going to be your transport mechanism for
shuttling the key back and forth. Available options are:
Funcitonal return of Login method / Explicit parameter on every method call.
HTTP Session Cookie (marshals automatically)
SOAP Header (marshals automatically)

4. When the user logs out, remove the flag from the cache. The corresponding
session key is no longer valid.
5. Keep in mind that you can specify expiration policies for information in
the cache. If a key arrives and the session is no longer in the cache, you
need to decide what approach to take. The standard approach would be to
force the user to re-authenticate and to create a new session. (GoTo Step
2.)

While the preceding is not a solution per se, I hope that this gives you a
bit of direction. If you have specific questions on any of these issues,
post back and we'll explore further.

Hope this helps,

Joseph Geretz
"JP" <JP@discussions.microsoft.comwrote in message
news:C6**********************************@microsof t.com...
>I have several sets of WS. The application making requests to these
services
must authenticate to the service by sending a UserName and Password

I wanted to set it up so that the parms were based at the WS level at the
time the application created an instance of the service. For example:

WebReference.ServiceName myService = new WebReference.ServiceName
("JP","password");
if this returns a 'ok' status then the app can use the methods in the
service

from this point on, the person can access any method in the service

string Name = myService.GetName("smith");

Basically I want to validate user credentials without having to pass the
username and password as parameters to every method in the service. I only
need to validate once.

I tried specifying the parms at the class level in the WS, but they wont
show up in the intelli-sense when I'm creating an instance.

How can I accomplish this?
--
JP
.NET Software Developer

Feb 28 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: David Hitillambeau | last post by:
Hi guys, As I am new to Python, i was wondering how to declare and use global variables. Suppose i have the following structure in the same module (same file): def foo: <instructions>...
1
by: Andr? Roberge | last post by:
I have the following two files: #--testexec.py-- def exec_code(co): try: exec co except: print "error" #-- test.py--
7
by: Lyn | last post by:
Hi and Season's Greetings to all. I have a question regarding the use of a qualifier word "Global". I cannot find any reference to this in Access help, nor in books or on the Internet. "Global"...
33
by: MLH | last post by:
I've read some posts indicating that having tons of GV's in an Access app is a bad idea. Personally, I love GVs and I use them (possibly abuse them) all the time for everything imaginable - have...
10
by: David P. Donahue | last post by:
When I wrote websites in VB .NET, I would often put functions in Global for all the pages to call. Now, in C#, doing so results in "references to non-static objects" and whatnot. I realize what...
9
by: CDMAPoster | last post by:
About a year ago there was a thread about the use of global variables in A97: http://groups.google.com/group/comp.databases.ms-access/browse_frm/thread/fedc837a5aeb6157 Best Practices by Kang...
3
by: User1014 | last post by:
A global variable is really just a property of the "Global Object", so what does that make a function defined in the global context? A method of the Global Object? ...
8
by: Rob T | last post by:
When I was using VS2003, I was able to compile my asp.net project locally on my machine and copy it to the production server and it would run just fine. I've now converted to VS2005. The project...
15
by: =?Utf-8?B?UGF0Qg==?= | last post by:
Just starting to move to ASP.NET 2.0 and having trouble with the Global.asax code file. In 1.1 I could have a code behind file for the global.asax file. This allow for shared variables of the...
1
weaknessforcats
by: weaknessforcats | last post by:
C++: The Case Against Global Variables Summary This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.