I’ve been working with some form processing providers and they seem to have a generic receiver for key-value pair data. I’m attempting to do this but every data-structure i’ve tried to use implements an interface and therefore cannot serialize the container for use in the webmethod.
I’ve even tried using the base ‘object’ data type – with no success
[WebMethod]
public void processResponse( object lead ){
Dictionary<string, string> DList = (Dictionary<string,string>) lead;
How can I receive an undefined number of key-value pairs using this webservice so i can perform business logic on the received data and intelligently route the data using a unified input method? Statically typed classes will not work in this instance as different types of leads have different numbers of fields/properties.
What I ended up doing was add a generic handler. I copied the QueryString parameter into a Dictionary and worked with the values from there. It sets a central point of data-collection and I was able to apply my business logic from there — seems to have suited the purpose of what I wanted.