AWS SDK Version 2 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

.NET Framework 3.5
 
The MD5OfMessageBody and MessageId elements.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceResponse
    Amazon.SQS.Model.SendMessageResult

Namespace: Amazon.SQS.Model
Assembly: AWSSDK.dll
Version: (assembly version)

Syntax

C#
public class SendMessageResult : AmazonWebServiceResponse

The SendMessageResult type exposes the following members

Constructors

NameDescription
Public Method SendMessageResult()

Properties

NameTypeDescription
Public Property ContentLength System.Int64 Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property HttpStatusCode System.Net.HttpStatusCode Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property MD5OfMessageAttributes System.String Gets and sets the property MD5OfMessageAttributes.

An MD5 digest of the non-URL-encoded message attribute string. This can be used to verify that Amazon SQS received the message correctly. Amazon SQS first URL decodes the message before creating the MD5 digest. For information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.

Public Property MD5OfMessageBody System.String Gets and sets the property MD5OfMessageBody.

An MD5 digest of the non-URL-encoded message body string. This can be used to verify that Amazon SQS received the message correctly. Amazon SQS first URL decodes the message before creating the MD5 digest. For information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.

Public Property MessageId System.String Gets and sets the property MessageId.

An element containing the message ID of the message sent to the queue. For more information, see Queue and Message Identifiers in the Amazon SQS Developer Guide.

Public Property ResponseMetadata Amazon.Runtime.ResponseMetadata Inherited from Amazon.Runtime.AmazonWebServiceResponse.

Examples

This example shows how to send a message.

Send message example

var client = new AmazonSQSClient();

var request = new SendMessageRequest
{
  DelaySeconds = (int)TimeSpan.FromSeconds(5).TotalSeconds,
  MessageAttributes = new Dictionary<string, MessageAttributeValue>
  {
    {
      "MyNameAttribute", new MessageAttributeValue 
        { DataType = "String", StringValue = "John Doe" }
    },
    {
      "MyAddressAttribute", new MessageAttributeValue 
        { DataType = "String", StringValue = "123 Main St." }
    },
    {
      "MyRegionAttribute", new MessageAttributeValue 
        { DataType = "String", StringValue = "Any Town, United States" }
    }
  },
  MessageBody = "John Doe customer information.",
  QueueUrl = "https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyTestQueue"
};

var response = client.SendMessage(request);

Console.WriteLine("For message ID '" + response.MessageId + "':");
Console.WriteLine("  MD5 of message attributes: " +
  response.MD5OfMessageAttributes);
Console.WriteLine("  MD5 of message body: " + response.MD5OfMessageBody);
      

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

.NET for Windows Store apps:
Supported in: Windows 8.1, Windows 8

.NET for Windows Phone:
Supported in: Windows Phone 8.1, Windows Phone 8