Dynamic web reference...

  • Thread starter Thread starter Mobileboy36
  • Start date Start date
M

Mobileboy36

Hello group,

Is there a way to make a web reference dynamic in a compact framework
Windows form application?
How can I make it so I can specify the reference in a config file?
Everything works fine with a stacic web refernce, but I need to make it
dynamic.

best regards,
MobileBoy
 
Simply set the Url property of the WSDL proxy generated class to your dynamic
address.

Simon.
 
Changing the behaviour to dynamic an using
me.URL = <dynamic adress> does not work.
It keeps the static reference.

No problem to achieve this in a full framework app...
 
The .NET CF does not have Reflection.Emit so its not capable of
dynamically generating web proxy classes. The only dynamic element is
the service endpoint through the Url property. The contract and
messages required by the web service must be consistent between service
endpoints, as defined by the static reference.

--
Neil Cowburn
Principal Partner
OpenNETCF Consulting, LLC.

Managed Code in the Embedded World

http://www.opennetcf.com/
http://www.smartdeviceframework.com/

Changing the behaviour to dynamic an using
me.URL = <dynamic adress> does not work.
It keeps the static reference.

No problem to achieve this in a full framework app...


--
 
Thanks Neil...
Does it mean you can't specify the url in a configfile in stead of a fixed
url in the property Window?
 
Setting the Dynamic flag will not create an app.config nor does it
add/change any of the key/value pairs in the applicationSettings.

You can create your own app.config and define the Web service endpoint in
that, and then in your code, read the app.config file and set the URL at
runtime. That's about as close to the desktop behavior as you are going to
get.

For reading the App.Config, check out the OpenNETCF.Configuration namespace
in the Smart Device Framework.

--
Neil Cowburn
Principal Partner
OpenNETCF Consulting, LLC.

Managed Code in the Embedded World

http://www.opennetcf.com/
http://www.smartdeviceframework.com/
 
Back
Top