Domanda

Approfittata di un nuovo progetto e ha aperto un file web.config di 1600 linea per un progetto WCF, dove il 90% dei servizi è configurato in modo identico (HMFPH).

Mi piace un progetto per essere facile da gestire, con il minor numero possibile di righe ridondanti.Quindi la mia domanda è se è possibile configurare più servizi WCF utilizzando invece la configurazione guidata con convenzione.

Tipo di Automapper di Nibernate fluente con la possibilità di creare sostituzioni quando necessario (come endpoint personalizzati, ecc.).qualche idea?

/ Jasper

È stato utile?

Soluzione

WCF in .NET 4 has a lots of convention-based configuration - as long as you don't start specifying your own stuff, each service defined in your web.config will get a default endpoint for each of the base addresses defined in your web.config - that alone can cut out 50-80% of your config.

Furthermore, you can define default behaviors, e.g. for your services; things like always expose metadata and make it available from HTTP and so forth can be defined once, as a "template" behavior and will be applied to all service entries without further ado.

Check out all the details of what's new in WCF 4 and how to make use of the convention-driven configuration ("no config WCF") here: A Developer's Introduction to WCF 4

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top