By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,805 Members | 1,202 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,805 IT Pros & Developers. It's quick & easy.

How to create a call a web service dynamically

P: n/a
We're programming in C# .net 1.1.

I've read that in order to create a web reference I can either (1) "Add A
Web Reference" from the VS 2003 IDE or (2) I can run the Wsdl.exe tool to
generate the source code file for the proxy class, compile the code file,
then copy the complied proxy class into the ASP.NET application /bin
directory.

Our goal is to make this all dynamic. So we would build our web reference
using the Wsdl.exe tool. Then we would need a way to call the web service
dynamically in code. Can I build a dynamic string in code to execute that?

Example:
string s1 = "WebService1.WS TestWS = new WebService1.WS();";
string s2 = "TestWS.FunctionName(param1, param2);";
And then somehow execute those commands. Is it possible?

Thanks for any help.
Mar 22 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,
You can use reflection to load the assembly and then by creating the
required type you can invoke a method by its name.

"dave" wrote:
We're programming in C# .net 1.1.

I've read that in order to create a web reference I can either (1) "Add A
Web Reference" from the VS 2003 IDE or (2) I can run the Wsdl.exe tool to
generate the source code file for the proxy class, compile the code file,
then copy the complied proxy class into the ASP.NET application /bin
directory.

Our goal is to make this all dynamic. So we would build our web reference
using the Wsdl.exe tool. Then we would need a way to call the web service
dynamically in code. Can I build a dynamic string in code to execute that?

Example:
string s1 = "WebService1.WS TestWS = new WebService1.WS();";
string s2 = "TestWS.FunctionName(param1, param2);";
And then somehow execute those commands. Is it possible?

Thanks for any help.

Mar 26 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.