B
Benne Smith
Hi,
I have three enviroments; a development, a testing and a production
enviroment. I'm making a big application (.exe), which uses alot of
different webservices.
I don't use the webservices by adding a WebReference, since it does not
allow me to keep state (cookiecontainer) or to specify functions on the
classes (like if i want to override the ToString() function on a class from
my webservice). So the only way i can see how i can get this option, is to
generate proxyclasses through wsdl.exe and add the class to my project.
It all works fine, but there's the deal... When I need to switch between a
Development build and a Test build, i've made entries in the Visual Studio
Configuration Manager (which I use with the #if and #endif). It allows me to
take different connectionstrings from the web.config etc.
But since I've generated my Proxy classes through wsdl.exe, it's constructor
has the folllwing line;
this.Url = "http://myserver/mywebservice/myservice.asmx";
This I could wrap with #if and #endif like so;
#if DEV
this.Url = "http://mydevserver/mywebservice/myservice.asmx"; // Notice
myDEVserver
#endif
#if TEST
this.Url = "http://mytestserver/mywebservice/myservice.asmx"; // Notice
myTESTserver
#endif
I also works just fine ! This way i can easily change between enviroments !
B U T (and here's the thing...) when i change a webservice, like
adding/deleting functions, I need to either; 1) edit the proxy class
manually, removing or adding the functions (beginInvoke..., endInvoke...)
corresponding to the changes, OR 2) re-generate the proxy class.
It's easy to see, that if you have a huge project, with loads of webservices
which changes alot, you have to do this alot of times. The problem is, that
when i re-generate the proxy classes, all my functions on the classes in the
proxyclass are overridden, and I have to manually copy them to the clipboard
or something like that, and paste them into the new proxy class, to keep
them.
THIS IS VERY TIME CONSUMING - and frankly drives me crazy !
Dos somebody have a nice solution to this "work process problem" ?
I'm using "Microsoft Development Enviroment 2002" (Microsoft Visual Studio
..NET).
Please help.
Thanks,
Benne
I have three enviroments; a development, a testing and a production
enviroment. I'm making a big application (.exe), which uses alot of
different webservices.
I don't use the webservices by adding a WebReference, since it does not
allow me to keep state (cookiecontainer) or to specify functions on the
classes (like if i want to override the ToString() function on a class from
my webservice). So the only way i can see how i can get this option, is to
generate proxyclasses through wsdl.exe and add the class to my project.
It all works fine, but there's the deal... When I need to switch between a
Development build and a Test build, i've made entries in the Visual Studio
Configuration Manager (which I use with the #if and #endif). It allows me to
take different connectionstrings from the web.config etc.
But since I've generated my Proxy classes through wsdl.exe, it's constructor
has the folllwing line;
this.Url = "http://myserver/mywebservice/myservice.asmx";
This I could wrap with #if and #endif like so;
#if DEV
this.Url = "http://mydevserver/mywebservice/myservice.asmx"; // Notice
myDEVserver
#endif
#if TEST
this.Url = "http://mytestserver/mywebservice/myservice.asmx"; // Notice
myTESTserver
#endif
I also works just fine ! This way i can easily change between enviroments !
B U T (and here's the thing...) when i change a webservice, like
adding/deleting functions, I need to either; 1) edit the proxy class
manually, removing or adding the functions (beginInvoke..., endInvoke...)
corresponding to the changes, OR 2) re-generate the proxy class.
It's easy to see, that if you have a huge project, with loads of webservices
which changes alot, you have to do this alot of times. The problem is, that
when i re-generate the proxy classes, all my functions on the classes in the
proxyclass are overridden, and I have to manually copy them to the clipboard
or something like that, and paste them into the new proxy class, to keep
them.
THIS IS VERY TIME CONSUMING - and frankly drives me crazy !
Dos somebody have a nice solution to this "work process problem" ?
I'm using "Microsoft Development Enviroment 2002" (Microsoft Visual Studio
..NET).
Please help.
Thanks,
Benne