Webservice To Webservice
-
Hi. I have created a component group consisting of a web service, windows service, database, etc. Each of these units(the component group being one unit) will be installed on a server (meaning each server will have a windows service, web service, database, etc). In order to call and use the web service I have consumed it and used it as a normal object. Ex: ExampleWebService myWebservice = new ExampleWebService(); myWebservice.Create(); Now my question is here. I have a part of my program which reads the webservices' URLs from a database, and needs to call each webservice in order to check if its still alive or not, a kind of heartbeat monitor if you will. From one webservice, how do I call another, knowing its URL and by consuming it ? Any help will be greatly appreciated, thanks.
-
Hi. I have created a component group consisting of a web service, windows service, database, etc. Each of these units(the component group being one unit) will be installed on a server (meaning each server will have a windows service, web service, database, etc). In order to call and use the web service I have consumed it and used it as a normal object. Ex: ExampleWebService myWebservice = new ExampleWebService(); myWebservice.Create(); Now my question is here. I have a part of my program which reads the webservices' URLs from a database, and needs to call each webservice in order to check if its still alive or not, a kind of heartbeat monitor if you will. From one webservice, how do I call another, knowing its URL and by consuming it ? Any help will be greatly appreciated, thanks.
If you have a web method in each web service that is the same (for example each web service has method Alive() which returns boolean), use WSDL to generate a proxy and include that in your project. You don't need to add web service references to your project.Now you can control better the url and other properties. From there on it's like calling a normal web service. Addition: See for example: Invoking a Web Service Without Web Reference[^] Mika
The need to optimize rises from a bad design. My articles[^]
modified on Thursday, November 20, 2008 3:40 PM
-
If you have a web method in each web service that is the same (for example each web service has method Alive() which returns boolean), use WSDL to generate a proxy and include that in your project. You don't need to add web service references to your project.Now you can control better the url and other properties. From there on it's like calling a normal web service. Addition: See for example: Invoking a Web Service Without Web Reference[^] Mika
The need to optimize rises from a bad design. My articles[^]
modified on Thursday, November 20, 2008 3:40 PM