c# - Programmatically Changing the Default Collection for WCF Proxy Class -


i have application users connect 1 or more wcf services running on machines in network. because address of these connections not known @ time of installation, application must programmatically connect these services (i.e. cannot use add service reference). have connection working using following code:

string url = "...the url..."; basichttpbinding binding = new basichttpbinding();             endpointaddress address = new endpointaddress(url); ilicenseservice service = channelfactory<ilicenseservice>.createchannel(binding, address); 

however, of members of service class return observablecollection of elements. know how change collection type in service reference dialog box, using advanced settings. however, cannot figure out way set value programatically client knows read return type observablecollection instead of list. clues?

it should deserialize type defined interface of service class, or type of property of serialized object. try changing collection type on interface/class.

by way, stated cannot use add service reference because service endpoint address not known @ compile time, shouldn't stop using it. obtain copy of wsdl , import in add service reference local wsdl file, when creating service proxy specify actual endpoint address shown here.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -