Web Service - Query
-
Hi All I am looking for a solution to a problem regarding web service. I want to call a web method of a web service, but I don’t want to use wsdl nor can I generate the proxy class. The scenario is that, in my application user can fill in the web service address and the method he wants to execute and I have to get the results. If any one could help me in this, that would be great. Waiting for reply, Sumit Domyan
-
Hi All I am looking for a solution to a problem regarding web service. I want to call a web method of a web service, but I don’t want to use wsdl nor can I generate the proxy class. The scenario is that, in my application user can fill in the web service address and the method he wants to execute and I have to get the results. If any one could help me in this, that would be great. Waiting for reply, Sumit Domyan
Hi there, There are several options which you may consider: + You can make a web request in code to call a web method, the url should be in the format:
http://servername/projectname/xmlwebservicename.asmx/methodname
+ You can create a general proxy class which accepts the url as the method parameter in its constructor. Then you can implement the
Invoke
method which can be used by the client to invoke a web method from the specified url. However, in both cases you need to think about the situation where the web method requires the user to supply the parameters to call the web method. For more information, you can see Exploring XML Web Service Content[^]