Programmatically add / remove web reference in C#

Discussion in 'ASP .Net Web Services' started by TC, Apr 22, 2005.

  1. TC

    TC Guest

    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
     
    TC, Apr 22, 2005
    #1
    1. Advertising

  2. 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.
     
    Keenan Newton, Apr 23, 2005
    #2
    1. Advertising

  3. TC

    TC Guest

    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" <> wrote in message
    news:...
    > 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, Apr 23, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Codex Twin
    Replies:
    1
    Views:
    476
    Axel Dahmen
    Jan 8, 2005
  2. John
    Replies:
    1
    Views:
    2,501
    Ken Cox
    Dec 1, 2005
  3. Replies:
    0
    Views:
    534
  4. Darko Bazulj
    Replies:
    0
    Views:
    755
    Darko Bazulj
    Oct 25, 2008
  5. Deep Mehta via .NET 247
    Replies:
    2
    Views:
    475
    Dave A
    May 31, 2005
Loading...

Share This Page