Q:

Is there a way to have my serialization method be more modular?

I have a method I am using to to work with a Json response.  Since this is part of a harness and I am going to be creating a number of different data objects is it possible to make this more generic so I don't have to create same code for each different data object I create.
[DataContract]
class Stats
{
    [DataMember]
    public string StatusCode {get;set;}
    [DataMember]
    public int ProspectCount {get;set;}
    [DataMember]
    public int MessageCount {get;set;}
    [DataMember]
    public int NewListingCount {get;set;}
    [DataMember]
    public int ReminderCount {get;set;}
    [DataMember]
    public int MyListingCount {get;set;}
    [DataMember]
    public int OfficListingCount {get;set;}

}

public static Stats SendRequest(string requestUrl)
{
    try
    {
        HttpWebRequest request = WebRequest.Create(requestUrl) as HttpWebRequest;
        using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
        {
            if (response.StatusCode != HttpStatusCode.OK)
                throw new Exception(String.Format(
                "Server error (HTTP {0}: {1}).",
                response.StatusCode,
                response.StatusDescription));
            DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(Stats));
            object objResponse = jsonSerializer.ReadObject(response.GetResponseStream());
            Stats jsonResponse
            = objResponse as Stats;
            return jsonResponse;
        }
    }
    catch (Exception e)
    {
        Console.WriteLine(e.Message);
        return null;
    }
}

I essentially want to be able to create a second and third data contract without having to recreate the SendRequest method.

A:

I ended up utilizing Json.NET for the serialization piece.  This will do everything I needed it to.    So now my method looks like:
    public static string ProcessRequest(string requestUrl)
    {
        try
        {
            HttpWebRequest request = WebRequest.Create(requestUrl) as HttpWebRequest;

            using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
            {
                string responseContents;
                if (response.StatusCode != HttpStatusCode.OK)
                    throw new Exception(String.Format(
                    "Server error (HTTP {0}: {1}).",
                    response.StatusCode,
                    response.StatusDescription));

                Stream responseStream = response.GetResponseStream();
                using(StreamReader readStream = new StreamReader(responseStream))
                {
                    responseContents = readStream.ReadToEnd();
                }

                return responseContents;
            }

        }
        catch (Exception e)
        {
            Console.WriteLine(e.Message);
            return null;
        }
    }

And the serialization component in another method is a simple one liner that takes the response as a string.:
Stats results = JsonConvert.DeserializeObject<Stats>(response);

