Dynamic Invoke Web Service in C#  
Author Message
Eric Chow





PostPosted: Visual C# General, Dynamic Invoke Web Service in C# Top

Hello,

It is easy to invoke web service by adding Web Reference with a specific WSDL, right

But how can I dynamic invoke a web service in C# If the URL of the web service or the location of the WSDL always locate in different server. I can't pre-added the web reference for that web service. How can I do

How can I add the web reference in run-time (in c# program by providing a WSDL url)

Could you please to show me a simple example

Very thank you.

Best regards,
Eric



Visual C#20  
 
 
SvenC





PostPosted: Visual C# General, Dynamic Invoke Web Service in C# Top

Change the Url property of the WebService proxy class to the destination where the WebService is implemented before calling any method on it.

--
SvenC


 
 
RizwanSharp





PostPosted: Visual C# General, Dynamic Invoke Web Service in C# Top

For different webservices you need to crete different Web Service Proxy class dynamically:

See these:

http://mikehadlow.blogspot.com/2006/06/dynamically-creating-web-service-proxy.html

http://msdn2.microsoft.com/en-us/library/d2s8y7bs.aspx

I hope this will help!

Best Regards,