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:
$objGsm = New-Object -ComObject AxSms.Gsm
$objMessage = New-Object -ComObject AxSms.Message
$objWapPush = New-Object -ComObject AxSms.TemplateWapPush
$objConst = New-Object -ComObject 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)
...
var objGsm = new AxSms.Gsm();
var objMessage = new AxSms.Message();
var objWapPush = new AxSms.TemplateWapPush();
var objConst = new 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);
...
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:
$objGsm = New-Object -ComObject AxSms.Gsm
$objMessage = New-Object -ComObject AxSms.Message
$objWapPush = New-Object -ComObject AxSms.TemplateWapPush
$objConst = New-Object -ComObject 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)
...
var objGsm = new AxSms.Gsm();
var objMessage = new AxSms.Message();
var objWapPush = new AxSms.TemplateWapPush();
var objConst = new 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);
...
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:
$objGsm = New-Object -ComObject AxSms.Gsm
$objMessage = New-Object -ComObject AxSms.Message
$objWapPush = New-Object -ComObject AxSms.TemplateWapPush
$objConst = New-Object -ComObject 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)
...
var objGsm = new AxSms.Gsm();
var objMessage = new AxSms.Message();
var objWapPush = new AxSms.TemplateWapPush();
var objConst = new 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);
...
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:
$objGsm = New-Object -ComObject AxSms.Gsm
$objMessage = New-Object -ComObject AxSms.Message
$objWapPush = New-Object -ComObject AxSms.TemplateWapPush
$objConst = New-Object -ComObject 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)
...
var objGsm = new AxSms.Gsm();
var objMessage = new AxSms.Message();
var objWapPush = new AxSms.TemplateWapPush();
var objConst = new 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);
...
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:
$objGsm = New-Object -ComObject AxSms.Gsm
$objMessage = New-Object -ComObject AxSms.Message
$objWapPush = New-Object -ComObject AxSms.TemplateWapPush
$objConst = New-Object -ComObject AxSms.Constants
...
$objWapPush.Description = "Innovators in Communication"
$objWapPush.Url = "www.auronsoftware.com"
$objWapPush.SignalAction = $objConst.WAPPUSH_SIGNAL_MEDIUM
$objWapPush.Encode()
if ($objWapPush.LastError -ne 0) {
Write-Host $objWapPush.QueryErrorDescription($objWapPush.LastError)
exit
}
...
var objGsm = new AxSms.Gsm();
var objMessage = new AxSms.Message();
var objWapPush = new AxSms.TemplateWapPush();
var objConst = new AxSms.Constants();
...
objWapPush.Description = "Innovators in Communication";
objWapPush.Url = "www.auronsoftware.com";
objWapPush.SignalAction = objConst.WAPPUSH_SIGNAL_MEDIUM;
objWapPush.Encode();
if (objWapPush.LastError != 0)
{
Console.WriteLine(objWapPush.GetErrorDescription(objWapPush.LastError));
return;
}
...
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:
$objWapPush = New-Object -ComObject AxSms.TemplateWapPush
...
$objWapPush.Clear()
...
var objWapPush = new AxSms.TemplateWapPush();
...
objWapPush.Clear();
...
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:
$objGsm = New-Object -ComObject AxSms.Gsm
$objMessage = New-Object -ComObject AxSms.Message
$objWapPush = New-Object -ComObject AxSms.TemplateWapPush
$objConst = New-Object -ComObject AxSms.Constants
...
$objWapPush.Description = "Innovators in Communication"
$objWapPush.Url = "www.auronsoftware.com"
$objWapPush.SignalAction = $objConst.WAPPUSH_SIGNAL_MEDIUM
$objWapPush.Encode()
if ($objWapPush.LastError -ne 0) {
Write-Host $objWapPush.GetErrorDescription($objWapPush.LastError)
exit
}
...
var objGsm = new AxSms.Gsm();
var objMessage = new AxSms.Message();
var objWapPush = new AxSms.TemplateWapPush();
var objConst = new AxSms.Constants();
...
objWapPush.Description = "Innovators in Communication";
objWapPush.Url = "www.auronsoftware.com";
objWapPush.SignalAction = objConst.WAPPUSH_SIGNAL_MEDIUM;
objWapPush.Encode();
if (objWapPush.LastError != 0)
{
Console.WriteLine(objWapPush.GetErrorDescription(objWapPush.LastError));
return;
}
...
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:
$objGsm = New-Object -ComObject AxSms.Gsm
$objMessage = New-Object -ComObject AxSms.Message
$objWapPush = New-Object -ComObject AxSms.TemplateWapPush
$objConst = New-Object -ComObject 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)
...
var objGsm = new AxSms.Gsm();
var objMessage = new AxSms.Message();
var objWapPush = new AxSms.TemplateWapPush();
var objConst = new 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);
...
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
...