Shortcut Menu

Skip

Main Navigation

Choose your language

You are here:

ActiveXperts.com > SMS and MMS Toolkit > About SMS > WAP Push Service Load

ActiveXperts SMS Component Add SMS capabilities to any Windows or .NET application

Quicklinks


Sending SMS WAP Push messages using the ActiveXperts SMS and MMS Toolkit.

Service Load

What is WAP Push ?

WAP Push, has been incorporated into the specification to allow WAP content to be pushed to the mobile handset with minimum user intervention. A WAP Push is basically a specially encoded message which includes a link to a WAP or WWW address. WAP Push is specified on top of WDP (WAP Datagram Protocol, resembled the UDP protocol in the Internet); as such, it can be delivered over any WDP-supported bearer, such as GPRS or SMS.

In most GSM networks, however, GPRS activation from the network is not generally supported, so WAP Push messages have to be delivered on top of the SMS bearer. The network entity that processes WAP Pushes and delivers them over an IP or SMS Bearer is known as a Push Proxy Gateway To receive WAP Push messages on your phone, it has to be WAP version 1.2 enabled.

There are 2 types of WAP Push messages. We will discuss the Service Load message here. For more details on sending Service Indication messages click here. Service Indication messages are used to notify the user that new WAP content is available, Service Load messages forces the phone to go directly to the content without user intervention (depending on the security level of your mobile phone).

WAP Push messages are encoded as XML. Because the XML format is not suitable for low bandwidth applications such as SMS, the messages are encoded using WBXML which stands for WAP Binary XML. When a message is encoded using this standard, common tags and attribute values are replaced with a single byte.

The full specification of this format van be found at www.w3.org.

Sample of a WAP Push message (Service Load) in XML:

<?xml version="1.0"?>
<!DOCTYPE sl PUBLIC "-//WAPFORUM//DTD SL 1.0//EN" "http://www.wapforum.org/DTD/sl.dtd">
<sl href="http://wap.yahoo.com" action="execute-low" ></sl>

The same WAP Push message in WBXML (excluding the WSP header) :

0x02                  WBXML Version 1.2
0x06                  SL 1.0 Public Identifier
0x6A                  Charset UTF-8
0x00                  String table length ( =0 ) 
0x85                  <sl>
0x0A                  href="http:// 
0x03                  start of string value 
0x77                  'w'
0x61                  'a'
0x70                  'p'
0x2E                  '.'
0x79                  'y'
0x61                  'a'
0x68                  'h'
0x6F                  'o'
0x6F                  'o'
0x2E                  '.'
0x63                  'c'
0x6F                  'o'
ox6D                  'm'
0x00                  end of string value
0x05                  action attribute ( 0x05 = execute-low )
0x01                  </sl>

Using the WAP Push object

The SMS and MMS Toolkit makes it easy to generate and deliver WAP Push messages. You can send WAP Push messages using a GSM modem (or GSM phone), or using an SMPP provider. Use the SmsDataWapPush object to format the message of the SMS, and use the regular SmsProtocolGsm or SmsProtocolSmpp functions to send the Wap Push formatted message.

The following code snippet shows how to encode the WAP Push message as shown above:

Set objWap              = CreateObject ( "ActiveXperts.SmsDataWapPush" )
Set objConstants        = CreateObject ( "ActiveXperts.SmsConstants" )

objWap.ConnectionType   = objConstants.asWAPPUSH_SERVICE_LOAD
objWap.ExecuteAction    = objConstants.asWAPPUSH_ACTION_EXECUTE_LOW
objWap.URL              = "http://wap.yahoo.com"

objWap.Encode

Used Parameters

ConnectionType

Specifies whether this is a Service Indication or Service Load WAP Push message. The most common used WAP Push type is the Service Indication. The following values are valid:

Value ActiveXperts Value/Constant
"service-indication" asWAPPUSH_SERVICE_INDICATION (0)
"service-load" asWAPPUSH_SERVICE_LOAD (1)

URL

The URL of the website we want to send the mobile to. The maximum length of this URL is 255 characters. The URL has to start with "http://" or "https://".

Execute Action

Specifies how the WAP Push message is displayed on the mobile phone. If this value is not specified, "signal-medium" will be used.

The following values are valid:

XML Value ActiveXperts Value/Constant WBXML Value
"execute-low" asWAPPUSH_ACTION_EXECUTE_LOW (0) 0x05
"execute-high" asWAPPUSH_ACTION_EXECUTE_HIGH (1) 0x06
"cache" asWAPPUSH_ACTION_CACHE (2) 0x07

"execute-low"

The WAP content is loaded without user intervention.

"execute-high"

The WAP content is loaded with user intervention.

"cache"

The WAP content is loaded in the cache of the phone (if exist), the content will not be executed directly.

Sending the encoded data

After all parameters has been set, you have to call the "Encode" function. This function does the actual encoding and returns the encoded data using the 'EncodedMessage' property.

If the "Encode" functions failes, you can check the "LastError" property to see what is going wrong.

The encoded data can be send using the SmsProtocolSmpp or SmsProtocolGsm object. Sending WAP Push messages using the SmsProtocolDialup object is not supported.

To retrieve an encode message from the object, you the "GetMessagePart" function. Please note that you have to set the messagetype to "asMESSAGEFORMAT_DATA_UDH" because the WAP Push data is encoded as 8 bit message data and includes UDH information for application port addressing. The samples below demonstrates how to send the messagedata using the SmsProtocolSmpp and SmsProtocolGsm objects:

SmsProtocolSmpp:

' WAP Push VBScript sample

objSmsProtocol    = CreateObject ( "ActiveXperts.SmsProtocolSmpp" )
objSmsMessage     = CreateObject ( "ActiveXperts.SmsMessage" )
objSmsConstants   = CreateObject ( "ActiveXperts.SmsConstants" )

objWap.Encode

objSmsProtocol.Server            = "smpp.activexperts-labs.com"
objSmsProtocol.SystemID          = "AX008"
objSmsProtocol.SystemPassword    = "812056"

objSmsProtocol.Connect

WScript.Echo "Connect, result #" & objSmsProtocol.LastError

If ( objSmsProtocol.LastError <> 0 ) Then
 WScript.Quit
End If

objSmsMessage.Format      = objSmsConstants.asMESSAGEFORMAT_DATA_UDH
objSmsMessage.Data        = objWap.EncodedMessage
objSmsMessage.Recipient   = "+31647134225"

objSmsProtocol.Send ( objSmsMessage )

objSmsProtocol.Disconnect

SmsProtocolGsm:

objSmsProtocol  = CreateObject ( "ActiveXperts.SmsProtocolGsm" )
objSmsMessage   = CreateObject ( "ActiveXperts.SmsMessage" )
objSmsConstants = CreateObject ( "ActiveXperts.SmsConstants" )

objWap.Encode

' Set Device
objSmsProtocol.Device           = "COM1"

' Set Message Properties
objSmsMessage.Format            = objSmsConstants.asMESSAGEFORMAT_DATA_UDH
objSmsMessage.Recipient         = "+31647134225"
objSmsMessage.Data              = objWap.EncodedMessage

objSmsProtocol.Send ( objSmsMessage )

  Download SMPP WAP Push (Service Load) Sample  (2 KB - .vbs file)   Download GSM WAP Push (Service Load) Sample  (2 KB - .vbs file)