Thread: Consuming same Web Service multiple times

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    20

    Consuming same Web Service multiple times

    Hi


    I have created a web service that search products and return them for consuming in my client application. Say now I want to put the web service into two or more servers (with different IP) and I want my client to ask all these services in order to gain product.
    When I do that in visual studio I do it manually and I add a web reference for the one web service and a web reference for the second web service, I add the namespaces and I call the method for each service manually.
    Now I need to do this automatically. That’s it to have the final exe and add the link of the web service I want (say in a configuration file) and my client working OK.

    Can this can happen (as I Know each time that you add a web reference it created a proxy, so it happen code generation) and how?


    I use VS 2005 and C# (VS 2003 is still ok)

    Thanks

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    I dont have a way to test it, but I think I know how to do it.

    In solution explorer, set the webservice "Url Behaviour" property to "Dynamic". Then you should be able to set the URL at runtime with the "URL" property.

  3. #3
    Registered User
    Join Date
    Jul 2004
    Posts
    20
    Hi

    I already know about dynamic Url Behavior. But my problem it is not solved by this. With this you can consume (yeap dynamically) one service at a time. That’s I want for my client is to ask all the web services and get the results from all the services.


    Say for example if I have my web service in server A and I add in my config

    http://A_IP.com/a.asmx

    And retrieve the data

    Say then that I put the web service AND to a second server B. My config becomes

    http://A_IP.com/a.asmx
    http://B_IP.com/a.asmx

    And retrieve from both servers

    I try to change the web.config, adding a second link (with the syntax that it uses for the one web service) but it does not working.......
    Last edited by cfriend; 01-10-2006 at 10:03 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MS Web Services Question
    By mercury529 in forum Windows Programming
    Replies: 0
    Last Post: 11-14-2006, 06:36 PM
  2. Phantom redefinition
    By CodeMonkey in forum C++ Programming
    Replies: 6
    Last Post: 06-12-2005, 05:42 PM
  3. Linker errors - Multiple Source files
    By nkhambal in forum C Programming
    Replies: 3
    Last Post: 04-24-2005, 02:41 AM
  4. Replies: 1
    Last Post: 05-01-2003, 02:52 PM