[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

Re: Dynamic URL in web references

Dino Chiesa [MSFT]

8/29/2003 3:32:00 PM

a few responses inline ...

"John Viele" <johnv@{NO_SPAM}goisc.com> wrote in message
news:e4eOeBBbDHA.1816@TK2MSFTNGP09.phx.gbl...
> Being able to simply set the web reference property "URL Behavior" to
TRUE
> in order to read web reference settings from the Web.Config file is
really
> handy. But, there are problems with this.
>
> First, I have consistently heard from my clients that putting an
unencrypted
> web reference into a text file on their web server is unacceptable. Since
> the Windows Installer implementation that comes with Visual Studio makes
it
> easy to set registry settings, and not nearly as easy to set Web.Config
> settings (HINT! Feature needed here!),

It is possible to build a custom-installer to build the xml file at install
time. This should be pretty simple to do using xml serialization. 10 lines
of extra code.

Also you can use an include statement in web.config, referring to an
external file.. In this way you can create the external file, include it
into web.config.

> ... my colleagues and I usually set web
> references in the registry.
>
> The down side of the registry approach is that you have to remember to
write
> code to fixup the web reference's URL property every time you instantiate
a
> web reference. Easy to forget, and can be a major PITA bug. In addition,
> you get the same objection with regard to lack of encryption. If you add
an
> encrypt/decrypt step to either the registry approach or the web.config
> approach, you have to write a custom install step AND you still have to
> remember to fixup your web references in your code wherever they are
> instantiated.
>
> ===========================================
> What's REALLY NEEDED is one of the following features:
> ===========================================
> 1) An automated way to indicate that Dynamic web references stored in the
> Web.Config must be encrypted when saved and decrypted when loaded (the
> automatically generated proxy code would obviously need to take this into
> consideration). Problem with this is how to specify how you want it
> encrypted.
>
> 2) An event hook on a web reference that gets called when its URL is about
> to be set. This would allow the programmer an easy way to plug in their
own
> brand of encryption/decryption by adding just one event handler function
to
> the web reference.
>

Did you try to inherit from the generated proxy and overriding the Url
property? I don't know if this is possible but if so you could hook it and
do what you want.


>
> (Hm, can you tell that I prefer option 2?)
>
> --John
>
>