Question

My question is related to the endpoints in wcf project. Which one is the better way to define the endpoints? Either one should define the endpoints in global.asax or endpoints in web.config? Which one is the better way and why?

Was it helpful?

Solution

So you mean do you define the endpoints in code or in xml configuration?

Well, they are functionally equivalent in every way, so from that perspective it's a personal choice.

The only real difference is that if you define your endpoints as xml config then you're not baking the service management and infrastructure concerns into the assembly, which in my opinion is much betterer.

OTHER TIPS

  • Are your endpoints dynamic?
  • Are you worried about changing the endpoints manually for different environments?
  • Do you plan to write unit tests on your endpoints infrastructure?

No, then you would be better off leaving the endpoints in web.config.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top