Question

Please can some one explain exactly what the URL Behaviour (Static or Dynamic) property for a Web Reference in Visual Studio is for.

I believe it affects where the URl for the Web Service is stored but I don't have a clear understanding.

Was it helpful?

Solution

I believe it affects where the URl for the Web Service is stored but I don't have a clear understanding.

That's right.

If you set it to dynamic, afterwards you can change url of web service (WebService.Url). Details here.

OTHER TIPS

Here's a bit more complete answer.

Dynamic automatically adds a setting that specifies Web Service URL. Yes, it can be managed through app.config, but the setting must reside in a specific place of app.config under <applicationSettings>.

Static makes the proxy's constructor to initialize Url property to its original value.

So if you have your own URL handling (e.g. the URL is retrieved from the database or resides in another section of app.config), URL Behaviour must be Static and changed later in your custom code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top