To complete the subsequent sections in this guide, you must make configuration changes to the sample files.
![]() | Tip |
|---|---|
If you don't want to write code, you can use the Amazon SQS scratchpad, a simple HTML and JavaScript application. |
The easiest way to explore Amazon SQS without writing any code is with the Amazon SQS scratchpad. To use the scratchpad, you must have an AWS account and be signed up for SQS (for more information, see Creating an AWS Account and Signing Up for SQS).
The scratchpad is a simple HTML and JavaScript application based on the 2008-01-01 version of SQS. You can use the scratchpad to understand what Query requests and responses for SQS look like, and to troubleshoot signature issues with Query requests.
To prepare the scratchpad
Go to the location of the scratchpad download.
Download the scratchpad and extract it to a working directory on your computer.
Open the index.html file with a web browser.
The welcome page is displayed.

Enter your Access Key ID and Secret Access Key (for more information, see Getting Your AWS Identifiers).
Follow the tutorial described in the remainder of this guide.
To prepare the sample files
Go to the location of the Java sample code that AWS provides and download the sample code package.
Extract the sample code into a directory on your machine.
Add all the sources under the
amazon-queue-2008-01-01-java-library/src directory to your
compilation path.
Add all the jar files under the
amazon-queue-2008-01-01-java-library/third-party directory to
your classpath.
Prepare each of the individual samples:
Open the
amazon-queue-2008-01-01-java-library/src/com/amazonaws/queue/samples/CreateQueueSample.java
sample file.
Make sure the following lines are not commented out and enter your Access Key ID and Secret Access Key.
String accessKeyId = "<Your Access Key ID>"; String secretAccessKey = "<Your Secret Access Key>" AmazonSQS service = new AmazonSQSClient(accessKeyId, secretAccessKey);
Make sure the following line is commented out.
AmazonSQS service = new AmazonSQSMock();
Save the file.
Repeat this procedure for each file in the samples
directory.
![]() | Note |
|---|---|
The mock service is an alternate way to use the sample code. The service doesn't call
AWS, but instead returns a set response that you can modify to suit your needs (the XML
response files are in the |
This guide discusses a C# sample based on Query requests. If you're planning to use C# with SOAP instead, consider using the AWS C# sample for SOAP, available at http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1172&categoryID=30.
To prepare the sample files
Go to the location of the C# sample code that AWS provides and download the sample code package.
Extract the sample code into a directory on your machine.
Open the following sample solution in Visual Studio 2005:
amazon-queue-2008-01-01-cs-library/src/Amazon.SQS.sln.
Press F5 and follow the instructions that are displayed.
Open the Amazon.SQS.Samples.cs file under the
Amazon.SQS.Samples project.
Make sure the following lines are not commented out and enter your Access Key ID and Secret Access Key.
String accessKeyId = "<Your Access Key ID>"; String secretAccessKey = "<Your Secret Access Key>"; AmazonSQS service = new AmazonSQSClient(accessKeyId, secretAccessKey);
Make sure the following line is commented out.
AmazonSQS service = new AmazonSQSMock();
Save the file.
![]() | Note |
|---|---|
The mock service is an alternate way to use the sample code. The service doesn't call
AWS, but instead returns a set response that you can modify to suit your needs (the XML
response files are in the |
To prepare the sample files
Go to the location of the Perl sample code that AWS provides and download the sample code package.
Extract the sample code into a directory on your machine.
Prepare each of the individual samples:
Open the
amazon-queue-2008-01-01-perl-library/src/Amazon/SQS/Samples/CreateQueueSample.pl
sample file.
Make sure the following lines are not commented out and enter your Access Key ID and Secret Access Key.
my $AWS_ACCESS_KEY_ID = "<Your Access Key ID>"; my $AWS_SECRET_ACCESS_KEY = "<Your Secret Access Key>"; use Amazon::SQS::Client; my $service = Amazon::SQS::Client->new($AWS_ACCESS_KEY_ID, $AWS_SECRET_ACCESS_KEY);
Make sure the following lines are commented out.
use Amazon::SQS::Mock; my $service = Amazon::SQS::Mock->new;
Save the file.
Repeat this procedure for each file in the Samples
directory.
![]() | Note |
|---|---|
The mock service is an alternate way to use the sample code. The service doesn't call
AWS, but instead returns a set response that you can modify to suit your needs (the XML
response files are in the |
To prepare the sample files
Go to the location of the PHP sample code that AWS provides and download the sample code package.
Extract the sample code into a directory on your machine.
Open the
amazon-queue-2008-01-01-php5-library/src/Amazon/SQS/Samples/.config.inc.php
file.
Enter your Access Key ID and Secret Access Key in the following lines and save the file.
define('AWS_ACCESS_KEY_ID', '<Your Access Key ID>');
define('AWS_SECRET_ACCESS_KEY', '<Your Secret Access Key>');Prepare each of the individual samples:
Open the
amazon-queue-2008-01-01-php5-library/src/Amazon/SQS/Samples/CreateQueueSample.php
file.
Make sure the following line is not commented out.
$service = new Amazon_SQS_Client(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY);
Make sure the following line is commented out.
$service = new Amazon_SQS_Mock();
Save the file.
Repeat this procedure for each file in the Samples
directory.
![]() | Note |
|---|---|
The mock service is an alternate way to use the sample code. The service doesn't call
AWS, but instead returns a set response that you can modify to suit your needs (the XML
response files are in the |
To prepare the sample files
Go to the location of the VB.NET sample code that AWS provides and download the sample code package.
Extract the sample code into a directory on your machine.
Open the following sample solution in Visual Basic 2005 Express:
<amazon-queue-2008-01-01-vbnet-library/src/Amazon.SQS.sln.
Press F5 and follow the instructions that are displayed.
Open the AmazonSQSSamples.vb file under the
Amazon.SQS.Samples project.
Make sure the following lines are not commented out and enter your Access Key ID and Secret Access Key.
Dim accessKeyId As String = "<Your Access Key ID>" Dim secretAccessKey As String = "<Your Secret Access Key>" Dim service As AmazonSQS = New AmazonSQSClient(accessKeyId, secretAccessKey)
Make sure the following line is commented out.
Dim service As AmazonSQS = New AmazonSQSMock()
Save the file.
![]() | Note |
|---|---|
The mock service is an alternate way to use the sample code. The service doesn't call
AWS, but instead returns a set response that you can modify to suit your needs (the XML
response files are in the |