Web Service without VS2004
-
I have created and consumed web services using C# and the VS2004 wizards. I would like to create an object that will consume a web service without using VS2004 Web Service Reference wizard. I have tried manipulating the files created by the wizard and have run into problems recompiling the code. The code seems to be heavily tied to the development environment. Is there any articles available on this topic? I have searched MSDN & Google. I have only found VS2004 way of doing things.
-
I have created and consumed web services using C# and the VS2004 wizards. I would like to create an object that will consume a web service without using VS2004 Web Service Reference wizard. I have tried manipulating the files created by the wizard and have run into problems recompiling the code. The code seems to be heavily tied to the development environment. Is there any articles available on this topic? I have searched MSDN & Google. I have only found VS2004 way of doing things.
Michael Potter wrote: I would like to create an object that will consume a web service without using VS2004 Web Service Reference wizard. If you are refering to the proxy class that is generated in Visual Studio when you "Add Web Reference", you can simply run the wdsl command line tool and pass it the web address to your web service, this will automatically generate the proxy class for you. There are a slew of options that you can specify such as the language used to generate the proxy, protocol to use (SOAP, HttpGet, HttpPost), a proxy domain and so on. I would recommend you take a look at Web Services Description Language Tool[^] for more information. - Nick Parker
My Blog | My Articles -
Michael Potter wrote: I would like to create an object that will consume a web service without using VS2004 Web Service Reference wizard. If you are refering to the proxy class that is generated in Visual Studio when you "Add Web Reference", you can simply run the wdsl command line tool and pass it the web address to your web service, this will automatically generate the proxy class for you. There are a slew of options that you can specify such as the language used to generate the proxy, protocol to use (SOAP, HttpGet, HttpPost), a proxy domain and so on. I would recommend you take a look at Web Services Description Language Tool[^] for more information. - Nick Parker
My Blog | My ArticlesThanks, that gets me a step further along. What I am having trouble with is setting up multiple servers with the same Web Service (debug, testing, production). All that really needs to change is the URL. I would like to do this without developing 3 seperate references in my code.
#if DEBUG private const string WS_URL = "DebugServer\TTCall.asmx" #else private const string WS_URL = "ProductionServer\TTCall.asmx" #endif
I have experimented with changing the URL on the fly. It worked for awhile. After a reload of VS it began to bitch that things were not in order. Any one have a better way of dealing with this issue?