/// <summary>
    /// Example testing DAPI endpoints using Classes
    /// </summary>
    public DAPIResponse runDAPICall(string method, Dictionary<string, string> args, UserToken userToken = null, AppToken appToken = null, string stringToken = null)
    {
        Uri u = new Uri("https://api.zynga.com");
        TTransport transport = new THttpModClient(u);
        TProtocol protocol = new TDAPIProtocol(transport);
        DAPI.Client client = new DAPI.Client(protocol);

        transport.Open();

        List<CallRequest> dapiCalls = new List<CallRequest>();
        CallRequest callRequest = new CallRequest();
        callRequest.Method = method;
        callRequest.Argz = args;
        dapiCalls.Add(callRequest);

        DAPIRequest dapiRequest = new DAPIRequest();
        dapiRequest.Calls = dapiCalls;
        dapiRequest.UserToken = userToken;
        dapiRequest.AppToken = appToken;
        dapiRequest.StringToken = stringToken;

        DAPIResponse dapiResponse = client.call(dapiRequest);

        transport.Close();

        return dapiResponse;
    }
    /// <summary>
    /// Example testing DAPI endpoints using raw JSON string
    /// </summary>
    public void runDAPITestSimple()
    {
        Console.WriteLine("Testing DAPI endpoints using raw JSON string");
        Uri u = new Uri("https://api.zynga.com");
        TTransport transport = new THttpModClient(u);
        TProtocol protocol = new TSimpleProtocol(transport);
        DAPI.Client client = new DAPI.Client(protocol);

        transport.Open();

        string requestBody = "{\"c\": [{\"m\":\"account.exists\", \"al\": {\"email\": \"" + TEST_EMAIL + "\"}}]}";
        var exists_simple = client.call_simple(requestBody);
        Console.WriteLine("  " + exists_simple + "\n");

        transport.Close();
    }
 public object getWebService(Type clazz)
 {
     if (this.protocol == null)
     {
         Uri u = new Uri("https://api.zynga.com");
         TTransport transport = new THttpModClient(u);
         TDAPIProtocol protocol = new TDAPIProtocol(transport);
         this.protocol = protocol;
         transport.Open();
     }
     Type[] types = new Type[1];
     types[0] = typeof(TProtocol);
     return clazz.GetConstructor(types).Invoke(new object[]{ this.protocol });
 }