How can we help?

AxSms.TemplateWapPush


Introduction

Skip to properties and methods

The Template… objects are used to generate SMS messages with special methods. You can set the properties according to your needs and call the Encode method to generate a message body. Set this body into an SMS and set the HasUdh property to true and the BodyFormat property to ‘BODYFORMAT_HEX’.

A WAPPush message can be used to push an URL to a mobile phone. The phone will show the URL along with a description and the option to visit this URL.

Note: Most modern smart phones, like the iPhone and recent Android based phones, no longer support this message type.

Properties and Methods

Property Type Read/Write Description
Url String Read/Write The URL to send
Description String Read/Write The description to send
SignalAction Number Read/Write The type of WAPPush action
Data String Read/Write The actual WAPPush message
LastError String Read Result of the last called method

Method Description
Clear Reset all properties to their default values
GetErrorDescription Get the description of the given error
Encode Creates the actual WAPPush message out of the property settings

Url property

This is the URL to send to the mobile device.

Example:

  Set objGsm = CreateObject("AxSms.Gsm")
  Set objMessage = CreateObject("AxSms.Message")
  Set objWapPush = CreateObject("AxSms.TemplateWapPush")
  Set objConst = CreateObject("AxSms.Constants")
  ...
  objWapPush.Description = "Innovators in Communication"
  objWapPush.Url = "www.auronsoftware.com"
  objWapPush.Signal = objConst.WAPPUSH_SIGNAL_MEDIUM
  objWapPush.Encode

  objMessage.ToAddress = "+31122334455"
  objMessage.Body = objWapPush.Data
  objMessage.HasUdh = true
  objMessage.BodyFormat = objConst.BODYFORMAT_HEX

  objGsm.SendSms objMessage
  ...

Description property

This is the description to go with the URL

Example:

  Set objGsm = CreateObject("AxSms.Gsm")
  Set objMessage = CreateObject("AxSms.Message")
  Set objWapPush = CreateObject("AxSms.TemplateWapPush")
  Set objConst = CreateObject("AxSms.Constants")
  ...
  objWapPush.Description = "Innovators in Communication"
  objWapPush.Url = "www.auronsoftware.com"
  objWapPush.SignalAction = objConst.WAPPUSH_SIGNAL_MEDIUM
  objWapPush.Encode

  objMessage.ToAddress = "+31122334455"
  objMessage.Body = objWapPush.Data
  objMessage.HasUdh = true
  objMessage.BodyFormat = objConst.BODYFORMAT_HEX

  objGsm.SendSms objMessage
  ...

SignalAction property

This is the signal action that should be used. It is either the priority of the WAPPush message
or sets it to delete.

Example:

  Set objGsm = CreateObject("AxSms.Gsm")
  Set objMessage = CreateObject("AxSms.Message")
  Set objWapPush = CreateObject("AxSms.TemplateWapPush")
  Set objConst = CreateObject("AxSms.Constants")
  ...
  objWapPush.Description = "Innovators in Communication"
  objWapPush.Url = "www.auronsoftware.com"
  objWapPush.SignalAction = objConst.WAPPUSH_SIGNAL_MEDIUM
  objWapPush.Encode

  objMessage.ToAddress = "+31122334455"
  objMessage.Body = objWapPush.Data
  objMessage.HasUdh = true
  objMessage.BodyFormat = objConst.BODYFORMAT_HEX

  objGsm.SendSms objMessage
  ...

Data property

After calling the Encode method this property will contain the WAPPush body as a HEX encoded string. To send this message set this body into an SMS and set the HasUdh property to true and the BodyFormat property to ‘BODYFORMAT_HEX’.

Example:

  Set objGsm = CreateObject("AxSms.Gsm")
  Set objMessage = CreateObject("AxSms.Message")
  Set objWapPush = CreateObject("AxSms.TemplateWapPush")
  Set objConst = CreateObject("AxSms.Constants")
  ...
  objWapPush.Description = "Innovators in Communication"
  objWapPush.Url = "www.auronsoftware.com"
  objWapPush.SignalAction = objConst.WAPPUSH_SIGNAL_MEDIUM
  objWapPush.Encode

  objMessage.ToAddress = "+31122334455"
  objMessage.Body = objWapPush.Data
  objMessage.HasUdh = true
  objMessage.BodyFormat = objConst.BODYFORMAT_HEX

  objGsm.SendSms objMessage
  ...

LastError property

Completion code of the last called method. To find the error description of a given error code, go to the online error codes codes page.

Example:

  Set objGsm = CreateObject("AxSms.Gsm")
  Set objMessage = CreateObject("AxSms.Message")
  Set objWapPush = CreateObject("AxSms.TemplateWapPush")
  Set objConst = CreateObject("AxSms.Constants")
  ...
  objWapPush.Description = "Innovators in Communication"
  objWapPush.Url = "www.auronsoftware.com"
  objWapPush.SignalAction = objConst.WAPPUSH_SIGNAL_MEDIUM
  objWapPush.Encode
  If objWapPush.LastError <> 0 Then
    WScript.Echo objWapPush.GetErrorDescription(objWapPush.LastError)
    WScript.Quit
  End If
  ...

Clear method

This method resets all properties to their default values.

Parameters:

  • None

Return value:

None

Example:

Set objWapPush = CreateObject("AxSms.TemplateWapPush")
...
objWapPush.Clear
...

GetErrorDescription method

GetErrorDescription provides the error description of a given error code.

Parameters:

  • The error code

Return value:

The error string.

Example:

Set objGsm = CreateObject("AxSms.Gsm")
Set objMessage = CreateObject("AxSms.Message")
Set objWapPush = CreateObject("AxSms.TemplateWapPush")
Set objConst = CreateObject("AxSms.Constants")
...
objWapPush.Description = "Innovators in Communication"
objWapPush.Url = "www.auronsoftware.com"
objWapPush.SignalAction = objConst.WAPPUSH_SIGNAL_MEDIUM
objWapPush.Encode
If objWapPush.LastError <> 0 Then
  WScript.Echo objWapPush.GetErrorDescription(objWapPush.LastError)
  WScript.Quit
End If
...

Encode method

Creates WAPPush message according to the current settings. After calling this method the Data property will contain the WAPPush body as a HEX encoded string. To send this message set this body into an SMS and set the HasUdh property to true and the BodyFormat property to ‘BODYFORMAT_HEX’.

Parameters:

  • None

Return value:

Always returns 0

Example:

Set objGsm = CreateObject("AxSms.Gsm")
Set objMessage = CreateObject("AxSms.Message")
Set objWapPush = CreateObject("AxSms.TemplateWapPush")
Set objConst = CreateObject("AxSms.Constants")
...
objWapPush.Description = "Innovators in Communication"
objWapPush.Url = "www.auronsoftware.com"
objWapPush.SignalAction = objConst.WAPPUSH_SIGNAL_MEDIUM
objWapPush.Encode

objMessage.ToAddress = "+31122334455"
objMessage.Body = objWapPush.Data
objMessage.HasUdh = true
objMessage.BodyFormat = objConst.BODYFORMAT_HEX

objGsm.SendSms objMessage
...