Dynamically Connect to Web Service?

  • Thread starter Thread starter T-Man
  • Start date Start date
T

T-Man

Hello,

I have an application in C# that makes calls to a web service and the app
currently contains a reference to a WSDL.

Since the server technology is a commercial product, some customers have
their own servers, etc.

I was wondering if it is possible to dynamically point the application to
any appropriate WSDL which would allow the C# code to continue to make the
simple method calls, etc.?

Regards,

Todd
 
change the URL behaviour on the web reference properties from within
Visual Studio's Solution Explorer for the proxy class.

http://msdn.microsoft.com/library/d...vbcon/html/vbtskGeneratingWebServiceProxy.asp
http://msdn.microsoft.com/library/d...ry/en-us/vsintro7/html/vxconWebReferences.asp


--
HTH

Ollie Riches
http://www.phoneanalyser.net


Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a programmer
helping programmers.
 
Hey Ollie,

I think that I need to rephrase the question.

Let's suppose that I have a dialog where a user can specify a URL.

How can I programmatically update or work with a webservice under such
circumstances?

For example, can I do something like the following:

webservice MyService=new webservice(URL);
Type MyResults=MyService.GetType(webservice_results[]);
webservice_results[] MyResults=MyService.CallMethod(param1,param2);

Can it be done that easily, that dynamically?

Regards,

Todd
 
Have a look at:

http://www.thinktecture.com/Resources/Software/DynWsLib/default.html

Johan

T-Man said:
Hey Ollie,

I think that I need to rephrase the question.

Let's suppose that I have a dialog where a user can specify a URL.

How can I programmatically update or work with a webservice under such
circumstances?

For example, can I do something like the following:

webservice MyService=new webservice(URL);
Type MyResults=MyService.GetType(webservice_results[]);
webservice_results[] MyResults=MyService.CallMethod(param1,param2);

Can it be done that easily, that dynamically?

Regards,

Todd




Ollie Riches said:
change the URL behaviour on the web reference properties from within
Visual Studio's Solution Explorer for the proxy class.

http://msdn.microsoft.com/library/d...vbcon/html/vbtskGeneratingWebServiceProxy.asp
http://msdn.microsoft.com/library/d...ry/en-us/vsintro7/html/vxconWebReferences.asp


--
HTH

Ollie Riches
http://www.phoneanalyser.net


Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer
helping programmers.
 

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

Back
Top