Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Services (http://www.velocityreviews.com/forums/f64-asp-net-web-services.html)
-   -   Programmatically add / remove web reference in C# (http://www.velocityreviews.com/forums/t784908-programmatically-add-remove-web-reference-in-c.html)

TC 04-22-2005 07:13 PM

Programmatically add / remove web reference in C#
 
Hello All,

I have winforms app that accesses a webservice and the WSDL is referenced
dynamically.

I was wondering 2 things:

First, if one parses the .config file and changes the URL pointing to the
WSDL, I take it that these changes would not take effect until the user
closes and restarts the app, correct?

The above said, is there a way to programmtically upload the newly parsed
..config file, or, better yet, is there a way to programmatically remove the
old reference and add a new reference pointing to the new WSDL?

Thanks & Regards,

TC




Keenan Newton 04-23-2005 02:08 PM

Re: Programmatically add / remove web reference in C#
 
Well I am assuming your trying to change the URL where your web service
is found at runtime. This is very easy to do by changing the URL
property on the generated web service proxy.

However, if your intent is to generate a new web service proxy on the
fly from a wsdl file. Then you would have to create your very own class
generator to interupt the wsdl, and generate a class file, compile that
file, and use refelction to call it up. To say the least not an easy
task.


TC 04-23-2005 05:03 PM

Re: Programmatically add / remove web reference in C#
 
Hey Guys,

Yep. I now see the 'URL' property of the proxy object.

Thanks a bunch! It's exactly what I was looking for.

Regards,

TC

"Keenan Newton" <kameleon_dj@yahoo.com> wrote in message
news:1114265300.547149.294150@l41g2000cwc.googlegr oups.com...
> Well I am assuming your trying to change the URL where your web service
> is found at runtime. This is very easy to do by changing the URL
> property on the generated web service proxy.
>
> However, if your intent is to generate a new web service proxy on the
> fly from a wsdl file. Then you would have to create your very own class
> generator to interupt the wsdl, and generate a class file, compile that
> file, and use refelction to call it up. To say the least not an easy
> task.
>





All times are GMT. The time now is 04:12 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.