Deploy a Callback Listening Service on Windows 7 and IIS 6.0

Introduction

Some requests sent to the Verizon ThingSpace Platform might take some time to process. Instead of blocking your application during that time, the ThingSpace Platform sends back an immediate (synchronous) acknowledgement that it has received and accepted the request, and it will send a complete response as a callback message when it has finished processing the request. In order to receive those responses, you must set up callback listening services on your server, and then register them with the ThingSpace Platform so that it knows where to send the responses.

This tutorial provides step-by-step instructions for deploying a callback listening service through IIS 6.0 on Windows 7, and registering the service with the Verizon ThingSpace Platform.

Before You Begin

The steps in this procedure assume that you have:

Configuring Firewalls

Firewalls are designed to block unwanted traffic coming from the Internet to an inside host. To make use of the callback feature described in this document, you must configure any firewalls between your computer and Verizon's ThingSpace Platform servers to allow the appropriate connections. (This is known as "white-listing.")

You (or someone at your company) should have received the list of IP addresses used by the Verizon M2M servers when your company was approved for API access to the ThingSpace Platform.

In addition to the main corporate firewall at your company, there may be internal firewalls, and your PC may have a firewall. All of these must be set to allow incoming traffic from Verizon for the specific port number on which you choose to set up your callback service.

Security Precaution

The "hole" in your PC firewall may compromise the security of your PC. You should reinstate the firewall when it is not required.

Open the Project

  1. Using Windows File Explorer, browse to the Wireless Network Services SDK Tools and Examples > CallbackService.ReferenceImplementation subdirectory:

  2. Open CallBackService.ReferenceImplementation.WNS.V2.csproj. Note that the example project is in VS2008 format; if you are using a newer version, Visual Studio will automatically convert the project files to the current format.

    Visual Studio should appear as shown:

Create the Callback Directory

  1. When you installed IIS, the system should have created a C:\inetpub\wwwroot directory structure.
  2. Using Windows Explorer, create a subdirectory under wwwroot named Callback:

    C:\inetpub\wwwroot\Callback

  3. In Windows Explorer, right click Properties and give IIS-IUSRS full rights to the callback directory:

Publish Your Project

  1. In Visual Studio, right click the highlighted line and select Publish:

  2. Cancel the Save File As pop up.
  3. Do not change the default Publish Profile name.
  4. Set the Publish Method to File System.
  5. The Target Location is the callback directory that you created:

  6. At the bottom left of the screen, a message indicates the success or failure of the operation:

  7. If the publish operation fails, give your Windows user account the rights to write to the directory.

Register the Client

Register the ASP.net 4.0 client with IIS:

  1. Open a CMD window with Administrator privileges.
  2. Navigate to C:\windows\Microsoft.NET\Framework\v4.0.30319 (or Framework64 for 64-bit machines).
  3. Enter aspnet-regiis.exe –i:

  4. If you register the client correctly, it should appear in IIS Manager %windir%\system32\inetsrv\InetMgr.exe:

Start or Restart the IIS Server

Click Start or Restart in IIS Manager:

Add the Callback to IIS

  1. In the IIS Manager, right-click on Default Web Site and select Add Application:

  2. Specify an alias, such as “Callback”.
  3. For the physical path, browse to the Callback directory that you created:

  4. Click OK.

Create Port Bindings

  1. To create the necessary bindings, select Default Web Site, then click Actions > Bindings.

  2. Add a binding for HTTP on port 50559:

    NOTE: Allowed port numbers for new callback registrations are 80, 443, 9001-9006 and 50551-50559.

    1. Do not enter a host name.
    2. Do not enter an IP address.

Use Anonymous Authentication

Use anonymous authentication so that there is no need to register a user name and password in UWS Explorer (later in this procedure).

  1. In the IIS Manager, select Default Web Site and then click the Authentication icon under the IIS heading:

  2. Ensure Anonymous Authentication is enabled, and that all other authentication types are disabled:

Check the Callback Service

  1. In the IIS Manager, select Callback under Default Web Site. You should see port 50599 listed on the right:

  2. Open a web browser and go to http://127.0.0.1:50559/. You should see the following screen:

  3. Browse to: http://127.0.0.1:50559/Callback/v1/CallbackService.asmx. You should see the Callback Service web page:

  4. In the CMD window, enter an ipconfig command.
  5. Obtain the IP address of your VPN adapter, such as 10.120.102.152.

Test Callbacks with UWS Explorer

  1. Run UWS Explorer and log in.
  2. Select the Callback Registration tab, as shown below.
  3. Unregister callbacks for CarrierService. Carrier Service provides API methods for Activate, Update Device Information, and more.
  4. Register your Callback Server: http://10.120.102.152:50559/Callback/API/CallbackService.asmx.

  5. In UWS Explorer:

    1. Select the Carrier tab.
    2. Click Load Custom Fields.
    3. Modify a custom field.
    4. Click Change Custom Fields.

  6. Use Wireshark® to verify that you are receiving traffic destined on port 50559.

    1. You should see SYN/SYN ACK, not RST.
    2. If there is no traffic, then your firewall is not open.
    3. If you see SYN but not SYN ACK, then your web server is turned off.

  7. Using Windows File Manager navigate to inetpub\wwwroot\callback. You should see the file CallbackService.ReferenceImplementation.log. This is where the callback logs are stored, including the callback request IDs and the responses.
  8. View the contents of this log and look for entries that say "".