Greetings, and a Happy 2012 to you!
You may have noticed that I’ve been rather absent from the blogosphere lately. I’ve been focusing on my transition to the Sybase/SAP Mobility team. That doesn’t mean I’ve abandoned my passion for PowerBuilder – that’s the tool that built my career, and it will always be a part of me. My day-to-day responsibilities are now with the Sybase Mobility stack, which includes Sybase Unwired Platform (SUP), Afaria, and the SQL Anywhere/MobiLink/UltraLite toolset. Therefore, the content that I publish in this blog will take a decided turn towards those tools. This entry will cover the steps necessary to use the Sybase Hosted Relay Server with your local install of SUP 2.1.
The iAnywhere Relay Server
The iAnywhere Relay Server is an optional (but critical, IMO) component of the Sybase/SAP mobile infrastructure. It’s essentially a reverse-proxy server that gets installed into a corporate DMZ, and implements an “inbound port” model to help insulate the server(s) inside the firewall from malicious internet traffic. It can be used with any of our mobile solutions, including SUP, Afaria, SQL Anywhere, and MobiLink. Mobile devices don’t need to be configured with the addresses/IPs/ports of the SUP server or farm – they only need the address and port of the Relay Server. The SUP server(s) make an outbound connection to the Relay Server using regular HTTP/S traffic, meaning that there are no open ports through the inner corporate firewall. Devices make an inbound connection to the Relay Server (again, HTTP/S on ports 80 or 443), and the Relay Server brokers the conversation between device and server, much like an old-time telephone operator at a switchboard. If the Relay Server is not implemented, the only other option to get devices and servers to communicate is to open specific TCP/IP ports for the SUP server through the inner and outer firewalls, and to configure the devices with the addresses of those SUP servers. I’ve not yet met a network admin that would readily agree to this…
Here is a white paper that outlines the Relay Server architecture in much more detail.
The Relay Server is included free-of-charge with SUP, Afaria, and SQL Anywhere, and runs inside Microsoft IIS or Apache web servers.
The Hosted Relay Server
Sybase has created a hosted implementation of the Relay Server, which is available for free to registered Sybase/SAP customers. This is designed to allow for development and test of small mobile deployments – it’s not to be used for production implementations (for obvious reasons). The URL for the hosted relay server is: http://relayserver.sybase.com/account. The first step is to submit a registration request, which will be reviewed by Sybase. Once approved, there are three main steps to connect a remote device to the SUP server farm.
1. Register the SUP Farm details
At the bottom of the account details page, you’ll find the individual hyperlinks to create the different types of server farm registrations. We’ll be creating an SUP farm. The Relay Server communicates with an SUP server “farm”, even if there’s only a single server node registered in that farm. This makes it easy to add and remove nodes from the farm, without having to reconfigure any of the mobile devices out in the field.
Click “Add New Sybase Unwired Platform Farm”, and this brings up the page shown in Figure 1.
I’ve placed the Relay Server registration page over the Sybase Control Center page, so it’s easier to see how to fill out the form. Since this example will focus on the Hybrid Web Container, we’ll create a Message-based Synchronization (MBS) farm. I’m also registering a Replication-based Sync (RBS) farm, even though this example is going to focus solely on the MBS capabilities of the Hybrid Web Container.
Give the farm a unique name. As you can see, I’ve called mine PHoranXP. The Relay Server will automatically append a suffix to the farm id, based on its type. The full name of the farm is composed as Registration Name (dot) Farm ID + suffix. Message-based farms get the letters MBS added, so its official name will be PaulHoran.PHoranXPMBS. The Replication-based Sync farm will be named PaulHoran.PHoranXPRBS. If I’d created a DCN farm, it would have been PaulHoran.PHoranXPDCN. Bottom line: don’t forget the registration name or the suffix…
Lastly, enter the server node name within the farm. This is comprised of the SUP server name that appears in the Sybase Control Center, plus the string “SUPServer1″. Mine happens to be named phoran-d630, so the server node name is phoran-d630SUPServer1. Click Create Farm to register the details to the Relay Server, and create a long alphanumeric “token” value for each farm type. You’ll be asked for this value in step 2 below. If you ever forget this value (and who could be expected to remember it?), just click on the Configuration Instructions link, and you’ll be taken to a page that lists all the pertinent info for your registration.
The remaining steps are performed in the Sybase Control Center (SCC), so open a session to the SUP server now.
2. Point SUP to the Hosted Relay Server
The SUP server establishes an outbound connection to the Relay Server through a component called the Relay Server Outbound Enabler, or RSOE. SUP needs to know the connection details to the Relay Server, and they’re configured in the Sybase Control Center. This is configured in the main server properties panel of SCC, in the Relay Servers tabpage. Figure 2 shows what this looks like:
Click the New… button to open the first screen of the registration wizard. Fill in the following values:
- Host: relayserver.sybase.com
- HTTP port: 80
- HTTPS port: 443
- URL suffix: accept the default value
- Description: your choice…
Click the Next button to navigate to the next panel in the wizard. This screen is a little more complicated, and is a two-step process. Figure 3 shows both of the wizard screens, already filled out.
We’re now working in the top half of the the second screen. Enter the full FarmID that was registered to the specific Relay Server/Type combination in step 1. Since I’m registering a messaging server, I’ll select Messaging in the Type field, and enter PaulHoran.PHoranXPMBS as the farm ID. Enter a description, if desired. Now click the yellow plus sign to register that combination. To create a second registration (for a Replication or DCN type), you would simply change the Type field to the desired value, change the suffix in the farm ID, and click the yellow plus sign again. If you make a mistake, simply select the row, and click the red X to delete it and start over.
Now we move to the bottom half of the screen, where you’re registering the server node within the farm ID and type. Select the appropriate row in the top list (I only have one, but you might have an MBS and an RBS row registered). Since this is a Master-Detail screen, it’s important to keep the relationships straight. Enter the Server Node ID and the corresponding Token value for that node in the corresponding fields, then click the BOTTOM yellow plus sign. (If it’s grayed out or disabled, make sure you have the correct row selected in the top half of the screen.) I’ve entered phoran-d630SUPServer1, and pasted in the correct token value from the Hosted Relay Server configuration page.
When everything is done correctly, your screen should look somewhat like the right side of Figure 3 above. Click Finish to record the registration and close the wizard.
3. Create the RSOE details
Figure 4 below shows how to find the panel for recording the properties of the Relay Server Outbound Enabler (RSOE) process.
Begin by clicking the yellow plus sign. This opens a three-panel wizard dialog for entering the properties, as shown in Figure 5 below. The good news is, this one is much easier to navigate. Select Messaging in the Farm Type field, and all the other properties will be automatically filled in.
The only modifiable options on the first screen are the port values. The RSOE process connects to the SUP server on port 5001, and out to the Relay server itself on port 80 or 443. Clicking Next> allows you to provide HTTP credentials (if necessary), and specify an HTTP proxy. The third and final screen allows for setting specific processing and logging options. These can all be modified later if necessary, so just accept the defaults and click Finish to complete the process.
The last step is to actually start the RSOE process. If registration was successful, a row should appear in the RSOE list. Select it, and click the Start button. Wait several seconds, then click the Refresh button to see the status of the RSOE process. The Status field should show as “Running”.
Configuring the SUP Container on Mobile Devices
Registering Users in Sybase Control Center
The first step in hooking up a device to SUP through the Hosted Relay Server is to register that username in SCC. This is done in the Application Connections tab of the Applications panel. Figure 6 shows the registration for my iPad device.
Note that the server name is set to relayserver.sybase.com on port 80 – not the default of phoran-d630 on port 5001. Set the Application ID to HWC to link the user to the Hybrid Web apps. Give the user an appropriate activation code, and click OK.
Configuring the Connection Properties on the Device
The SUP Hybrid Web Container for iOS 4.x/5.x can be downloaded directly from the Apple Appstore here. The first thing you’ll do after downloading and installing it, is configure the connection properties in the Settings app.
- Server Name: relayserver.sybase.com
- Server Port: 80 (or 443, if you configured the secure HTTP connection)
- Farm ID: the entire farm ID, including the registration name and suffix – mine is PaulHoran.PHoranXPMBS
- User Name/Activation Code: the username and activation code that were registered above.
- Password: provide a 6-digit password, or leave this blank to force the user to reenter the HWC password each time the app is reactivated.
Once these connection properties are set, and the Hybrid Web Container is launched, a connection is made to SUP through the Relay Server to download all the registered Hybrid Web apps that have been assigned to the device user.