Creating a New Project

This section shows you how to create the new project, set up libraries, and define the structure of your program.

The Java project consists of one source file, and SOAP proxy classes generated by Apache Axis from the web service's WSDL file.

The C# project uses the "Console Application" template provided by Microsoft Visual C#. The code is placed in the Program.cs file provided by the template, and accesses the web service's SOAP interface using a .NET Web Resource.

To create the C# project

  1. Open Microsoft Visual C# 2006 Express Edition. If you are using another version of Microsoft Visual Studio, these steps might be slightly different.

  2. Create a new project using the "Console Application" template.

    1. From the File menu, select New Project... A dialog box opens.

    2. From the available templates, select Console Application.

    3. For the name of the project, enter DoGetAccountBalance.

    4. Click OK. A new project is created with a Program.cs file and an empty main routine.

  3. Replace the contents of Program.cs with the following text:

    // Use classes
    using System;
    using System.Collections.Generic;
    using System.Text;
    
    namespace DoGetAccountBalance
    {
        class Program
        {
            // Define constants
    
            // Define authentication routines
    
            // Define other support routines
    
            static void Main(string[] args)
            {
                try
                {
    
                    // Set up the web service client
    
                    // Construct the request
    
                    // Calculate and set the request authentication parameters
    
                    // Set other parameters
    
                    // Make the request
    
                    // Check for and print results and errors
    
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.ToString());
                }
    
                // Pause the output so you can run this directly in Visual Studio.
                Console.WriteLine("Press Enter to exit...");
                Console.Read();
            }
        }
    }
    	
  4. Generate the SOAP proxy classes by adding a .NET Web Reference to the project.

    1. From the Project menu, select Add Web Reference... A dialog box opens.

    2. For the URL, enter the URL of the web service WSDL:

      http://mechanicalturk.amazonaws.com/AWSMechanicalTurk/2006-10-31/AWSMechanicalTurkRequester.wsdl
    3. Click Go. The service WSDL is retrieved over the network.

    4. Click Add Reference. The Web Reference classes are generated and added to the project.

  5. In Program.cs, add a line to use the generated Web Reference classes, as follows:

    // Use classes
    [...]
    using DoGetAccountBalance.com.amazonaws.mechanicalturk;
    	

The Perl project consists of one source file.

The PHP project consists of one source file.

The Python (REST) project consists of one source file.

The Python (SOAP) project consists of one source file.

The Ruby (REST) project consists of one source file.

The Ruby (SOAP) project consists of one source file.