Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Adding Web Refrence at runtime

Adding Web Refrence at runtime

Scheduled Pinned Locked Moved C#
questiondatabasewcfsysadminwindows-admin
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sabry1905
    wrote on last edited by
    #1

    Hello All I have a group of applications that working on a LAN and there was another application -reporting tool- that may use the databases of all other applications through web services -each application provide a web service to give access to its database-, and this is working good, the problem is that I had to make a new build for the reporting tool each time a new application added to the group, this is absolutely not happening every day, but I was think in an optimized solution, which I think is to make the reporting tool call the IIS in every machine on the network to get the web services that is available, and then provide the admin by a list of the web services then prompt him to add reference to the web services that he wish to connect with, this means that I should add web references at the runtime. I don’t know if I can call the IIS to do that, or if I can add web references at runtime, but I thought on the problem as a logic which I don’t know if it can be done or not. my question is, is this can be done?, and how to do it?

    W 1 Reply Last reply
    0
    • S Sabry1905

      Hello All I have a group of applications that working on a LAN and there was another application -reporting tool- that may use the databases of all other applications through web services -each application provide a web service to give access to its database-, and this is working good, the problem is that I had to make a new build for the reporting tool each time a new application added to the group, this is absolutely not happening every day, but I was think in an optimized solution, which I think is to make the reporting tool call the IIS in every machine on the network to get the web services that is available, and then provide the admin by a list of the web services then prompt him to add reference to the web services that he wish to connect with, this means that I should add web references at the runtime. I don’t know if I can call the IIS to do that, or if I can add web references at runtime, but I thought on the problem as a logic which I don’t know if it can be done or not. my question is, is this can be done?, and how to do it?

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      If the methods you use in the reporting tool, are the same in each of the web services, you can create your own (single) proxy. The easiest way is to use WSDL tool and possibly strip off everything you don't need from the generated file. Now you can better control the change of the URL and also other properties of the proxy. Also when you add the generated class to you code, you don't need to add web references anymore. Hope this helps you, Mika

      The need to optimize rises from a bad design. My articles[^]

      S 1 Reply Last reply
      0
      • W Wendelius

        If the methods you use in the reporting tool, are the same in each of the web services, you can create your own (single) proxy. The easiest way is to use WSDL tool and possibly strip off everything you don't need from the generated file. Now you can better control the change of the URL and also other properties of the proxy. Also when you add the generated class to you code, you don't need to add web references anymore. Hope this helps you, Mika

        The need to optimize rises from a bad design. My articles[^]

        S Offline
        S Offline
        Sabry1905
        wrote on last edited by
        #3

        sorry i can't understand this, please give me a link for an example or article

        W 1 Reply Last reply
        0
        • S Sabry1905

          sorry i can't understand this, please give me a link for an example or article

          W Offline
          W Offline
          Wendelius
          wrote on last edited by
          #4

          Few links I quickly found: - Web Services Description Language Tool (Wsdl.exe)[^] - Creating an XML Web Service Proxy[^] - Reverse Engineering Through WSDL.EXE[^] - Invoking a Web Service Without Web Reference[^] I hope these would help you. The idea is that the services you call contain the same web methods (at least the ones you use). So when you add a new service or want to change the service, you actually use the same proxy and change the url.

          The need to optimize rises from a bad design. My articles[^]

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups