I'm interested in creating a web service endpoint in C#/.NET that is fully configurable. To keep it simple assume there is no GET/query/retrieval requirement. I just need some guidance on how to get started here.
The goal is to have a a core solution built, tested, and deployed that can then be configured for new objects thus avoiding a requirement to modify, build, and deploy the entire solution anytime an object is added/removed/modified. This configuration would have to support versioning given the environment it will operate in.
Assume we have a configuration file such as the following:
{
"V1": {
"Person": [
{
"Name": "FirstName",
"Required": true,
"Type": "string",
"MaxLength": 25
},
{
"Name": "Lastname",
"Required": true,
"Type": "string",
"MaxLength": 25
},
{
"Name": "Title",
"Required": false,
"Type": "string",
"MaxLength": 50
}
]
},
"V2": {
"Person": [
{
"Name": "FirstName",
"Required": true,
"Type": "string",
"MaxLength": 25
},
{
"Name": "Lastname",
"Required": true,
"Type": "string",
"MaxLength": 25
},
{
"Name": "Title",
"Required": false,
"Type": "string",
"MaxLength": 50
},
{
"Name": "DateOfBirth",
"Required": false,
"Type": "DateTime"
}
]
}
}
With this configuration I want an application that will expose an endpoint for a caller to send an object and validate the object against the type rules. It should also expose a WSDL.
To be clear, I do not want to write a simple single generic endpoint that can take an array of key-value attributes and then validate - I want to generate a contract.
In essence, I'm trying to have a contract web service while not having to create POCOs. This will allow senders to more easily mock the endpoint for their development work.
For the curious, the incoming data will be sent to a messaging bus to be processed by other services. Thus, the endpoint needs to do the evaluation of type/length/etc but I don't want to create/update the POCOs and controllers along with all the testing and headaches of an enterprise deployment simply because some object has a new field.