Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Get the number the SMS came from,
            string fromNumber = Request["From"];

            // Create the client to be used to invoke the lambda function.
            // This will use the default credentials from the profile store.
            var config = new AmazonLambdaConfig {
                RegionEndpoint = RegionEndpoint.EUWest1
            };
            IAmazonLambda client = AWSClientFactory.CreateAmazonLambdaClient(config);

            // Arguments for the lambda function - the number the SMS came from.
            string arguments = @"{""to"": """ + fromNumber + @"""}";

            // Invoke the lambda function which will send a reply to the SMS message.
            client.InvokeAsync("SimpleSMS", arguments);
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Create the client to be used to invoke the lambda function.
            // This will use the default credentials from the profile store.
            var config = new AmazonLambdaConfig {
                RegionEndpoint = RegionEndpoint.EUWest1
            };
            IAmazonLambda client = AWSClientFactory.CreateAmazonLambdaClient(config);

            // Arguments for the lambda function
            const string arguments = @"{""key1"": ""argument 1"", 
                                        ""key2"": ""argument 2"",
                                        ""key3"": ""argument 3""
                                       }";

            // Invoke the lambda function
            InvokeAsyncResponse response = client.InvokeAsync("HelloWorld", arguments);

            Response.Write("Completed with response code: " + response.HttpStatusCode);
        }