Prepare your development environment

If you intend to submit your messages via SOAP, follow these steps to verify that your environment is capable of sending web-to-postal messages through PostalMethods:

  1. From your server, verify that you can view a live page on the PostalMethods server at https://api.postalmethods.com/PostalMain.asmx (HTTPS, port 443) or at http://api.postalmethods.com/PostalMain.asmx (HTTP, port 80). If you can't, check your internet connection, firewall settings, and proxy settings. We recommend using the HTTPS secure connection.
  2. Scroll down to your development environment for further instructions:

Java

  1. You need to have Java 1.5 or newer to access the PostalMethods API using Java. To determine your version of Java, run following command on the command line:

    java -version

    The output will look something like:

    java version "1.6.0_03"
    Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
    Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)

    You should also check to make sure that you have the Java development tools installed. You can do this by running the following command:

    javac -version

    The output will look something like this:

    javac 1.6.0_06

  2. Download and unpack the latest PostalMethods Java toolkit files into a directory. On Windows, use your favorite zip utility to unzip the file into its own directory. On Linux, run the command unzip pmjava.zip. You will now have a directory called pmjava that contains all of the files you need to get started.

Visual Studio 2002 & 2005 (C# and VB.NET)

  1. Create a new project
  2. Select the "Console Application" template
  3. Create a Web Reference:
    Using the Solution Explorer, right-click on the project name (by default: "ConsoleApplication1"):

    • Click the "Add Web Reference" button
    • In the URL line, write https://api.postalmethods.com/PostalMain.asmx and hit the "Go" button
    • Once the Web Service is detected, click the "Add Reference" button

Visual Studio 2008 (C# and VB.NET)

  1. Create a new project
  2. Select the "Console Application" template
  3. Create a Web Reference:
    Using the Solution Explorer, right-click on the project name (by default: "ConsoleApplication1"):

    • Select "Add Service Reference"
    • Click the "Advanced" button
    • Click the "Add Web Reference" button
    • In the URL line, enter https://api.postalmethods.com/PostalMain.asmx and hit the "Go" button
    • Once the Web Service is detected, click the "Add Reference" button

PHP 5

  1. Determine your version of PHP by running a file with the following contents on your server:
    <?php
    echo phpinfo();
    ?>

    The title of the resulting page will indicate the version number of your PHP installation, for example PHP version 5.2. Proceed if you have version 5 or higher (no support is offered here for PHP4.x; see GoPHP5).

  2. Verify your SOAP library - in the resulting page from step #3, search for the phrase --enable soap. If it's present - you have the required SOAP library installed (it usually is). If not, you need to either recompile PHP with this option enabled, or use PostalMethods via HTTP POST or SMTP.

Perl

  1. You need to have the SOAP::Lite module, version 0.60 or greater, installed. To verify that SOAP:Lite is properly installed and to display its version, run this code from a Perl script:
    use SOAP::Lite;
    print $SOAP::Lite::VERSION . "\n";
  2. If SOAP::Lite is not installed you will need to install the module by running:
    perl -MCPAN -e 'install SOAP::Lite'

Python

  1. Verify Python is installed. Invoke the Python interpreter by typing 'python' in a command shell. You should see something similar to this:
    $ python
    Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
    >>>
  2. Install the Zolera SOAP Infrastructure (ZSI) module. Verify that it is available by attempting to import it:
    >>> import ZSI
    >>>

    If you do not have ZSI you will need to install it. The steps for doing this differ from one system to another but the installation is described with the ZSI distribution.

Ruby

Unix

  1. Make sure you have a working Ruby and gem service and that you have permissions to 'sudo'
  2. In 'Terminal', run this command: “sudo gem install postalmethods”

Windows

  1. Make sure your path includes the Ruby and gem command
  2. Run the following command: "gem install postalmethods". You may use the "Ruby for Windows" installer.

ASP

  1. You need to have Microsoft SOAP Toolkit Version 3.0 installed. To verify that it is properly installed, add the following code to an ASP page:
    <%
    Dim X : Set X = Server.CreateObject("MSSOAP.SoapClient30")
    Response.Write "SOAP is available"
    %>
  2. To run your script Using IIS:
    1. Place your script in a folder (e.g. C:\PostalMethods\myscript.asp)
    2. Open IIS Manager. Under Local computer -> Web sites -> Default web site -> [Right click] new -> Virtual Directory. Alias: PostalMethods; Directory: C:\PostalMethods
    3. Open your browser and type: http://localhost/interfax/myscript.asp
  3. If you are sending letters from behind a proxy using Microsoft SOAP Toolkit Version 3.0, you can use one of the two following options:
    • Option 1 - Use automatic detection by:
      objSoap.ConnectorProperty("EnableAutoProxy") = True
    • Option 2 - Specify a proxy server:
      objSoap.ConnectorProperty("ProxyServer") = "192.168.0.100"
    • Optionally, if the proxy server is password-protected specify:
      objSoap.ConnectorProperty("ProxyUser") = "Proxy Username"
      objSoap.ConnectorProperty("ProxyPassword") = "Proxy Password"

ColdFusion

  1. Currently supported environments are ColdFusion 7 and ColdFusion 8. All necessary libraries are built into these environments.