Introduction
WAP Push SMS messages are widely used for pushing polyphonic ringtones and wallpaper images to mobile
phones. However, as you will see, they also present a compelling method
of directing people to WAP sites without visibility on the operator's
WAP Portals.
This article presents a set of C# classes that generate an SMS message that instructs a mobile to browse to a given URL.
Instructing The Device
WAP
Push messages can contain a number of different bodies all designed to
accomplish slightly different outcomes. The one we are interested in is
the Service Indication
. This is an XML
document (DTD here
) that contains a URL for the handset to browse to. For example:
<si>
<indication href="http://wap.yahoo.com/" action="signal-high">
A WAP Push to the Yahoo site
</indication
</si>
In the mobile world, bandwidth and reliable connections are at a
premium, so the method for getting this message to a device needs to be
reliable and compact. XML has many strengths, compactness however is not
one of them. Step in SMS
and WBXML
.
SMS is a reliable (depending on the service provider) store and
forward mechanism for sending messages to mobile devices. Its use is not
limited to person to person communication. It drives voice mail alerts,
phone configurations, MMS notifications, and a whole host of other
features we expect from mobile networks. The problem is that it is
restricted to 140 bytes of data.
WBXML is binary format of XML that allows for compact
transmission, while still preserving the structure and content of XML
documents. Devices have inbuilt knowledge of certain XML DTDs that they
are able to parse and understand.
One way this compactness is achieved is by a Tag Code Space being
reserved for each DTD. Instead of the full tag name being sent, just a
byte value is used to indicate the presence and position of the Tag. The
Tag Code Space for the Service Indication DTD is shown below:
Tag
Byte Value
si
|
0x05
|
indication
|
0x06 |
Another method is to replace common attributes and known values with byte values. In the case of the action
attribute of the indication
tag, which gives an indication of what level of interruption the device should attempt on receipt of this message, these are:
Attribute
Byte Value
action="signal-none"
|
0x05
|
action="signal-low"
|
0x06
|
action="signal-medium"
|
0x07
|
action="signal-high"
|
0x08
|
action="signal-delete"
|
0x09 |
Use of these methods allow the XML document to be compressed
sufficiently for transmission by SMS to the target device. A full
description of the Service Indication can be found at the WAP Forum
section of the Open Mobile Alliance
web site.
Pushing The Instruction
Now that the instruction in the form of a Service Indication
has been encoded, the data needs to be packaged into an SMS message.
This requires two additional protocol layers to be wrapped around the
instruction in order that it is read correctly by the recipient device.
The first layer is the WSP (Wireless Session Protocol). This is
analogous to HTTP in the wired world, where a series of headers describe
the content that is contained. As with the WBXML encoded Service
Indication, these are actually transported as well known byte values in
order to preserve bandwidth. The headers used in the WAP Push message
are:
- CONTENT-TYPE
- CONTENT-LENGTH
- APPLICATION-TYPE
Finally, the WDP (Wireless Datagram Protocol). For those of you who
are familiar with sending Smart Messages to Nokia phones like VCard,
Ringtones, Operator Logos, etc., this is the UDH (User Data Header).
This contains an information element that describes the destination port
on the mobile phone. This is used by the phone to decide which
application it should fire up on receipt of this message. In our case,
the WAP Browser.
Once all the layers are in place, you now have a series of bytes that have to be submitted to the mobile phone.
Using the code
The core classes comprise a ServiceIndication
which is responsible for creating the content of the push; and PushMessage
which is responsible for generating the complete message by wrapping the additional protocol layers. The classes WBXML
, WSP
, and WDP
are holders for constants and statistics relating to the different
protocol layers. The following code demonstrates how the body is
generated:
string
href = "http://wap.yahoo.com"
;
string
text = "A WAP Push to the Yahoo site"
;
PushMessage message = new
PushMessage(href, text);
HexDecoder decoder = new
HexDecoder();
string
body = new
string
(decoder.GetChars(message.GetSMSBytes()));
I have included a HexDecoder
class we use internally for converting a byte array into Hex string.
Once the message body has been created, it's a simple process to
send the message using a mobile phone connected to the PC's serial port,
or an SMS Web Service such as this
.
Points of Interest
The great thing about sending these kinds of messages to mobile
phones is that they ignore them if they don't understand them. It makes
debugging a nightmare.
I started with the Service Indication specification on the OMA
web site but discovered that the handsets out there are not as
up-to-date. In order to get this to work, I had to drop the creation and
expiry attributes as well as drop the version number to 1.1.
The ServiceIndication
class encodes itself to WBXML
in a fairly procedural way. Tempted as I was to write a generic WBXML
encoder, XP teaches us that simple is good ;).
The content length byte value in the WSP header has the high byte
set, which suggests that the content is restricted to 128 bytes. This
makes sense given the 140 bytes available, if anyone can clarify the
position on this, I would appreciate it.
相关推荐
在IT行业中,短信(SMS)和彩信(MMS)是两种常见的移动通信技术,而WAP PUSH则是一种用于向移动设备发送数据的服务。这里我们将深入探讨这些技术的工作原理、应用场景以及它们之间的关联。 首先,短信(Short ...
Java短信系统SMS是一种基于Java开发的短信服务平台,它具备发送普通短信、长短信以及WAP Push短信的功能。在本文中,我们将深入探讨这些关键概念及其在IT行业中的应用。 首先,我们来理解普通短信(Short Message ...
它主要负责提供多种业务的接入和控制,包括短信(SMS)、彩信(MMS)、WAP Push等。这些接口文档详细阐述了ISAG与外部系统间的交互规范,确保各种服务的高效、稳定运行。 1. **总册**:《中国电信综合业务接入网关_...
标题中的"WapPush2.rar_PDUdecoding ja_WAP_Push_Java_push_wap push_wappush"揭示了这个压缩包文件与WAP推送(WAP Push)技术有关,特别是涉及PDU解码(PDudecoding)以及Java编程语言的应用。WAP Push是一种在移动...
- **消息格式验证**:确保发送的Push消息符合WAP Push协议标准,如WSP(Wireless Session Protocol)和WTP(Wireless Transaction Protocol)。 - **网络测试**:检查网络环境对Push服务的影响,如信号质量、延迟和...
1. **消息格式**:WAP PUSH消息遵循OTA SMS(Over The Air Service Setting)的格式标准,这是WAP Push消息的一种类型,用于传递设置信息。消息通常包括一个PDU(Protocol Data Unit)部分和一个SI(Service ...
WAP Push的主要功能是发送短消息服务(SMS)或多媒体消息服务(MMS)形式的通知,通知中包含指向WAP内容(如网页、图像等)的链接。当用户点击该链接时,移动设备会自动打开WAP浏览器并加载指定的内容。 #### 三、...
9. **com.esendex.articles.wappush.csproj**: 这是一个项目文件,包含了整个WAP Push源码项目的配置信息,如编译设置、引用的库和其他依赖项。 10. **App.ico**: 这是项目的图标文件,用于在应用程序或系统中显示...
WAPPUSH处理通常涉及到一系列的技术和组件,用于构建一个能够支持SP(服务提供商)的WAP网站推送功能的模块。下面将详细解释这个主题以及压缩包中的文件可能涉及的知识点。 1. **WAP Push技术**:WAP Push是基于WAP...
WAP Push服务允许服务提供商向用户的手机发送内容,这些内容通常以MMS或SMS的形式封装,然后通过WAP Gateway转发到目标设备。用户接收后,可以通过WAP浏览器访问推送的内容。 搭建WAP Push Gateway的第一步是选择...
在这个名为"WapPush.rar"的压缩包中,包含的是一段Java源代码,用于实现WAP Push服务,尤其是CMPP(China Mobile Packet Protocol)相关的功能,这在中国移动网络环境下广泛使用。 CMPP,全称为中国移动集团短信...
WAPPUSH API,下发WAP PUSH
**Android 添加 WAP Push 功能详解** WAP Push(Wireless Application Protocol Push)是一种在无线应用协议中用于向移动设备推送信息的技术。它允许服务提供商将数据如MMS消息、新闻更新、天气预报等推送到用户的...
WAP Push通常基于WAP Gateway进行操作,它能将互联网上的内容转化为适合移动设备接收的格式。 MMS是WAP Push的一个重要应用场景,用于发送包含文本、图片、音频甚至视频等多媒体内容的消息。MMS协议定义了如何在...
在IT行业中,与“电信网关smgp短信彩信wappush接口文档和实例代码”相关的知识涵盖了多个领域,特别是移动通信服务的开发。这里,我们将深入探讨这些关键概念及其在Java开发中的应用。 首先,让我们理解每个核心...
尽管WAP Push提供了比传统SMS更多的功能,但它仍然能够与SMS兼容。这意味着即使是在不支持WAP Push的设备上,也可以通过SMS来传递推送消息,从而确保所有用户都能够接收到推送内容。 #### 推送API Openwave PPG...
**WAP PUSH消息格式** WAP PUSH消息通常包含两部分:PDU(Protocol Data Unit)头部和消息内容。PDU头部包含了消息的元数据,如目标地址、消息类型、优先级等。消息内容可以是MIME编码的任何类型的数据,如HTML、...
WAP Push SP接口协议遵循WAP Forum制定的标准,如WAP Push Profile(WSP)和WAP Pushover SMS Profile。这些标准确保不同厂商的产品和服务能够互操作。 7. **应用实例** - **铃声和壁纸**:用户可以自动接收新...