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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With