Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / December 2004

Tip: Looking for answers? Try searching our database.

Redirect client webservice location at runtime - VB.Net

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stewart Saathoff - 02 Dec 2004 03:41 GMT
Hello,

I would like to programatically redirect the location of a web service from
the client machine.  Let me explain further.  This is the exact process:

I would like the client to click a menu bar like Tools -> Server Address
and be able to type the location of the webservice.  I would then save this
data to the registry and when the client works in the application, they
would be making calls to the specified web service.

Any help would be greatly appreciated.

- Stewart
Drew Marsh - 02 Dec 2004 04:12 GMT
Stewar Saathoff wrote:

> I would like to programatically redirect the location of a web service
> from the client machine.  Let me explain further.  This is the exact
[quoted text clipped - 6 lines]
>
> Any help would be greatly appreciated.

Just set the Url property[1] of the proxy class to whatever they enter and
you should be good to go.

HTH,
Drew

[1] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlr
fsystemwebservicesprotocolswebclientprotocolclassurltopic.asp?frame=tru

Stewart Saathoff - 02 Dec 2004 05:32 GMT
Thanks,

I'll try that

- Stewart

> Stewar Saathoff wrote:
>
[quoted text clipped - 17 lines]
> [1]
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlr
fsystemwebservicesprotocolswebclientprotocolclassurltopic.asp?frame=true
Dan Rogers - 02 Dec 2004 21:08 GMT
Hi Stewart,

A word of advice about using the registry for settings.  If you want to
support clients running on Citrix or similar technologies, you'll have
issues if you use the registry.  A solution in this case might be to
consider using the application.config file instead.

Regards,

Dan Rogers

--------------------
From: "Stewart Saathoff" <stew@noSpam.net>
References: <OCGVWFC2EHA.3816@TK2MSFTNGP09.phx.gbl>
<91308632375395803906250@msnews.microsoft.com>
Subject: Re: Redirect client webservice location at runtime - VB.Net
Date: Wed, 1 Dec 2004 23:32:39 -0600
Lines: 32
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
Message-ID: <ORPZdDD2EHA.1192@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: ppp53-238.accesscom.net 67.128.53.238
Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:7745
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Thanks,

I'll try that

- Stewart

> Stewar Saathoff wrote:
>
[quoted text clipped - 16 lines]
>
> [1]

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemwebservicesprotocolswebclientprotocolclassurltopic.asp?frame=true
Stewart Saathoff - 06 Dec 2004 19:47 GMT
But can I save using the app.config file dynamically?  I was unaware that
there was a function like Write App.Config...

Stewart

> Hi Stewart,
>
[quoted text clipped - 59 lines]
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
> frlrfsystemwebservicesprotocolswebclientprotocolclassurltopic.asp?frame=true
Drew Marsh - 06 Dec 2004 20:03 GMT
> But can I save using the app.config file dynamically?  I was unaware
> that there was a function like Write App.Config...

There isn't and you shouldn't. I don't think Dan was suggesting you write
to the app.config file, just get your settings from there. If you need to
write a config file you should be doing that in separate file managed per
user using something like IsolatedStorage.

HTH,
Dre
Stewart Saathoff - 06 Dec 2004 20:42 GMT
Well, that was the entire thing.  I want users to be able to change the path
dynamically.  What do you do in the case of CTX???

>> But can I save using the app.config file dynamically?  I was unaware
>> that there was a function like Write App.Config...
[quoted text clipped - 6 lines]
> HTH,
> Drew
Drew Marsh - 06 Dec 2004 21:22 GMT
> Well, that was the entire thing.  I want users to be able to change
> the path dynamically.  What do you do in the case of CTX???

Like I said, you need to keep a separate config file for user settings. The
reason for this is two fold:

1) Security Settings - corporate user's often don't have access to change
files outside of their own personal folder (i.e. can't modify app.config
in program files)
2) Multiple Users - if the machine is used by more than one user, they might
have different settings. So, if you kept the settings in one file, user A
would override user B's settings. Or, worse, user A might see user B's sensitive
settings.

So for storing the custom config file you can use Isolated Storage (which
has a nice side effect of setting your app for SmartClient usage), or you
can use Environment.GetFolder with Environment.SpecialFolder.ApplicationData
and throw a custom directory in there for your product. Either way, the file
is specific to the user and you don't have to worry about security/multiple
users.

HTH,
Dre

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.