C Board  

Go Back   C Board > General Programming Boards > C# Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 01-10-2006, 04:16 AM   #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
cfriend is offline   Reply With Quote
Old 01-10-2006, 05:32 AM   #2
&TH of undefined behavior
 
Fordy's Avatar
 
Join Date: Aug 2001
Posts: 5,219
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.
__________________
"If A is success in life, then A equals x plus y plus z. Work is x; y is play; and z is keeping your mouth shut."
Albert Einstein (1879 - 1955)


Board Rules
Fordy is offline   Reply With Quote
Old 01-10-2006, 09:59 AM   #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.
cfriend is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Web Services Question mercury529 Windows Programming 0 11-14-2006 06:36 PM
Phantom redefinition CodeMonkey C++ Programming 6 06-12-2005 05:42 PM
Linker errors - Multiple Source files nkhambal C Programming 3 04-24-2005 02:41 AM
Using multiple source files: Multiple Declarations & Wrong line numbers Inquirer C++ Programming 1 05-01-2003 02:52 PM


All times are GMT -6. The time now is 10:59 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22