Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Managing multiple WCF endpoints for the same service

Tags:

c#

.net

wcf

I am building an single application that uses WCF to call out to multiple external endpoints. All of the remote endpoints are identical except for the URI. I would like to treat them as a pool: add and remove endpoints through configuration and have the application understand what to do.

My original plan was to define one endoint in the app.config, then iterate over my list of endpoints and update client.Endpoint.Address on the fly to point to the right place. Unfortunately, that property is read-only, rendering that plan unworkable.

I'm a little bit stumped here. Any suggestions on how I might accomplish this?

like image 595
Jacob Avatar asked Nov 14 '22 11:11

Jacob


1 Answers

How to: Create a Service Endpoint in Code shows you how to manage service endpoints in code rather than configuration.

like image 125
Jason Punyon Avatar answered Dec 16 '22 10:12

Jason Punyon