Creating Proxy Classes Using Microsoft Visual Studio 2010

System_CLiX_note Note

Atlas is now part of Facebook. To access Atlas API documentation, please click here.

To use the Organization service with Microsoft Visual Studio 2010, your project is required to use the Microsoft.NET Framework version 3.0 or newer (version 3.5 or version 4). You must also add to your project a service reference to the Organization service. You can then develop applications by using the Organization service with Visual Studio 2010.

  1. Open Visual Studio 2010.

  2. Create a new Visual C# or Visual Basic project. In the combo box that appears in the New Project dialog box, select either .NET Framework 4, .NET Framework 3.5, or .NET Framework 3.0.

  3. After the project has been created, on the Project menu, click Add Service Reference.

  4. We recommend that you use message contracts when you create your client proxy, although it is not required. Create a client proxy that uses message contracts by using the following steps:

    1. In the Add Service Reference dialog box, click Advanced.

    2. In the Service Reference Settings dialog box, select the Always generate message contracts check box (if it is not selected already).

    3. Click OK.

  5. In the Add Service Reference dialog box, type the following web service URL in the Address field.

  6. Click Go. Visual Studio then contacts the Organization service.

  7. In the Namespace field, type a descriptive name for the namespace. This can be any name you want as long as it is unique within your project; for example, Atlas_OrgService.

  8. Click OK. Visual Studio then creates the necessary files and adds them to your project.

Add a using or Imports statement to your code to include the namespace that was created by the service reference. The following shows what a C# using statement would look like for the Organization service reference that was previously created.

using <project name> .Atlas_OrgService;

Imports <project name> .Atlas_OrgService

Replace <project name> with the name of your project.

You are now ready to begin writing code that uses the Organization service. For an example of code that uses the Organization service, see Get Agency Branches in C#.