Calling Web Services Dynamically

F

francoisdt

Hi Steve

I would like to know how can I do the following.:

Write a software that will call web services dynamically
depends upon settings save upon database.

So the webservice call is not hard-coded but for example
I have a user interface that let a user pick and choose
which web service to use on a set of data.
Save the settings and then when user clicks on a button
the code in the button will read the "action'" that must be
taken upon the data from database and then the name of
web service and url and parms will be read from dynamically and
populated dynamically. So no web service is hard coded.

In such a way one can have a user interface displaying data
and when user clicks a button it will execute the webservice
'action'" that is linked to the button.

The code in the button will just read from database table which
webservice
to execute and this string as a generic procdure that will execute the
web wervice.
This way limitless webservices can be executed instead of hard coded
references and proxies that need to be recompiled

Regards
Francois du Toit
 
S

Sherif El-Metainy

Greetings

This sample also has what you want
http://www.gotdotnet.com/community/...mpleguid=35c47ebb-d806-4995-8797-a42251a8ace3
It works like the sample Josh posted but also has source code.

Please note that both samples rely on creating an assembly for the web
service proxy at runtime, then loading and running it. .NET assemblies
cannot be loaded unless the AppDomain is unloaded. This may be OK for a
console application or a desktop application that is not running for a long
time, or an application that is not processing too many web services. But
for a Windows service or a web application your application will suffer from
loading too many assemblies.

You have to evaluate how loading too many assemblies will affect your
application.

Another approach is create the assembly in a separate AppDomain and using
marshaling to pass data from and to that AppDomain, then unloading the
AppDomain. This is not a very attractive solution, but will solve the
assembly unloading problem.

Best regards,
Sherif El-Metainy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top