Dyanamically change Reference for Web Service?

L

L Lewis

Can the URL used to define the Web Service be changed at runtime? We
would like to develop a client pointing to a test box during
development, then point it to a production web service during
production. It appears the reference is embedded in the DLL. Is this
right? Can it be changed at runtime?
I am a newbie to .NET programming, so forgive me if this is a very
basic question.
 
J

Jan Tielens

An alternative:

Select your web service from the solution explorer window, and set the
URLBehavior property to Dynamic. A app.config file is generated, that
contains a setting for the web service url. You can alter the value of this
setting by editing the config file (plain xml) without having to rebuild
your project.
 
K

Kit

Dear Al

I am now also facing a problem on changing URL in web reference.
Firstly, i added a web reference in my project, and then i change the URL value for the Web Service by coding
An error showed like
"Server did not recognize the value of HTTP Header SOAPAction:http://XXXXXX"

It seems that my program remembered the original URL setting in web reference.

Please help and thanks

Kit
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top