473,387 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to create a call a web service dynamically

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
1 1573
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Bil Muh | last post by:
Esteemede Developers, I would like to Thank All of You in advance for your sincere guidances. I am developing a software using Visual C++ .NET Standard Edition with Windows Form (.NET)...
2
by: Sean | last post by:
Hello all, I may just not be searching for the right thing, but I've been looking for a way to dynamically create controls (and name them) in my code so that I can create only the controls I...
1
by: Fred W | last post by:
I have 2 dependent dropdowns and would like to populate the contents of the child dropdown dynamically based on the selected item of the parent. Pretty standard requirement. However, can this...
2
by: Call Web service dynamically. | last post by:
I have VC++.NET application which takes the Webservice URL at the runtime from the user and it should call the webservice method based on what the user has supplied.
2
by: markoZ | last post by:
Hi. We have developed a .NET web service. The service executes a SQL on the SQL server. The first call of the webservice takes very long but the other calls dont. Why is that and how can we...
4
by: jesper_lofgren | last post by:
Hi there, I have some webcontrols that i want to add dynamically on a page. I have stored the path / namespace in database (ex MyNameSpace.WebControls.Control1) to the class/webcontrol. Lets...
5
by: ljlevend2 | last post by:
Is there any way to create a local server during runtime? For example, if you add an existing Web Site to a Solution from within Visual Studio (by right clicking the solution in the Solution...
4
by: Benny Dein | last post by:
Hi I want to create a servlet or something similar by which im able to create virtual webservices. Lets say i would like to create a webservice with a method called 'getDate' which returnes...
18
by: Angus | last post by:
Hello We have a lot of C++ code. And we need to now create a library which can be used from C and C++. Given that we have a lot of C++ code using classes how can we 'hide' the fact that it is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.