Thursday, 15 March 2012

c# - WCF Discovery with multiple contracts type -



c# - WCF Discovery with multiple contracts type -

wcf novice here.

my service has 4 endpoints 4 different contract. because had requirement fulfill. now, don't want utilize fixed port , read here utilize listenurimode="unique" in endpoint configuration first free port use.

this works , service goes correctly. since don't know port has been used have utilize wcf discovery reach service.

my client search endpoints code

discoveryclient discoveryclient = new discoveryclient(new udpdiscoveryendpoint()); findcriteria findcriteria = new findcriteria(typeof(imyserviceinterface)); findcriteria.duration = timespan.fromseconds(5); findresponse findresponse = discoveryclient.find(findcriteria); messagebox.show(string.format("endpoints found: {0}", findresponse.endpoints.count));

this works, endpoint imyserviceinterface interface. can 4 scans , 4 endpoints, sounds wrong way (and requires 4 times normal time complete).

how can this? creating endpoint , giving him function comunicate others endpoint? or i'm doing in wrong way , i'm wasting time?

c# wcf discovery

No comments:

Post a Comment