Sending a WapPush SMS (Nearly there)

Sending a WapPush SMS (Nearly there) SearchSearch
Author Message
alan skinner
Unregistered guest
Posted on Wednesday, April 21, 2004 - 05:38 pm:   

Hi Bryce/Everybody.

I am having some issues sending Wap Push messages

There has been plenty of talk so far but once and for all when i sort this out I will put up a full post about how to do it properly, anyway on with my problem.


I am using a Nokia Artuse CIMD2 SMSC

I am receiving garbage text on the mobile


So what am I doing....

I know that a wap push over SMS looks like

WP = UDHeader + WSPHeader + WBXMLdata

The format i am using is this...

a UDH which would look like

0B050423F023F00003840101 or 06050423F023F0

basically this breaks down as

0B // User Data Header Length
05 // UDH IE: Port numbers
04 // Port number length
23 // Destination port (high)
F0 // Destination port (low)
23 // Originating port (high)
F0 // Originating port (low)
00 // UDH IE SAR
03 // UDH SAR IE length
84 // Data gram ref number
01 // Total number of segments in data gram
01 // Segment count

I have used ports 23F0 = 9200 Is this correct? i think so


WSPHeader

I use this code to create the header (taken from Nokia OTA Service Settings document)

String ContentType="text/vnd.wap.si";
String WapPush;

WapPush.Append(ToHex(0x01)); // Transaction/Push ID
WapPush.Append(ToHex(0x06)); // PDU TYPE
WapPush.Append(ToHex(ContentType.Length+4)); // Header Length
WapPush.Append(ToHex(ContentType.Length+1)); // Value Length strlen ("text/vnd.wap.si"+1)
WapPush.Append(ToHex(ContentType)); // text/vnd.wap.si
WapPush.Append("00"); // End of string
WapPush.Append(ToHex(0x81)); // Charset
WapPush.Append(ToHex(0xEA)); // UTF-8

giving WSPheader = 01061310746578742F766E642E7761702E73690081EA

[Function ToHex() just converts the data to hex strings]

is this header correct?



WBXMLdata


Next I create the binary WBXML data which specifies the URl etc.
I am using this XML..

<?xml version="1.0"?>
<!DOCTYPE si PUBLIC "-//WAPFORUM//DTD SI 1.0//EN" "http://www.wapforum.org/DTD/si.dtd">
<si>
<indication href="http://www.xyz.com/abc.wml" si-id=1>
hello
</indication>
</si>

and i create it according to Doc, "wap-167-serviceind-20010731-a.pdf"

the code goes like

// WBXML1.1 data
WapPush.Append(ToHex(0x02)); // <?xml version="1.0"?>
WapPush.Append(ToHex(0x05)); // <!DOCTYPE si PUBLIC "-//WAPFORUM//DTD SI 1.0//EN" "http://www.wapforum.org/DTD/si.dtd">
WapPush.Append(ToHex(0x04)); // 0x6A=Charset=UTF-8 0x04=Charset=iso-8859-1
WapPush.Append(ToHex(0x00)); // String table length
WapPush.Append(ToHex(0x45)); // <si> (with content)
WapPush.Append(ToHex(0xC6)); // <indication> (with content and attributes)
WapPush.Append(ToHex(0x0D)); // href="http://www.
WapPush.Append(ToHex(0x03)); // inline String follows
WapPush.Append(ToHex("xyz")); // The URL
WapPush.Append("00"); // End of string
WapPush.Append(ToHex(0x85)); // .com/
WapPush.Append(ToHex(0x03)); // inline String follows
WapPush.Append(ToHex("abc.wml")); // MMS Filename
WapPush.Append("00"); // End of string
WapPush.Append("11033100"); // si-id=1
WapPush.Append(ToHex(0x01)); // end of indication attribute list
WapPush.Append(ToHex(0x03)); // inline String follows
WapPush.Append(ToHex("hello")); // Message
WapPush.Append("00"); // End of string
WapPush.Append(ToHex(0x01)); // end of <indication> element
WapPush.Append(ToHex(0x01)); // end of <si> element



Finally this creates the data

WBXMLdata = 0205040045C60D0378797A0085036162632E776D6C0011033100010368656C6C6F000101


so I use header 0B050423F023F00003840101
and data 01061310746578742F766E642E7761702E73690081EA0205040045C60D0378797A0085036162632E 776D6C0011033100010368656C6C6F000101

but I am getting the garbage text

can anybody tell me what I am doing wrong

Thanks for any help

Alan



Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 2353
Registered: 10-2002
Posted on Thursday, April 22, 2004 - 05:10 pm:   

Hi Alan,

Have you tried configuring NowSMS to use a CIMD2 connection?

It builds the WAP Push PDU automatically ...

There may be other problems in your push attempt, but the destination port is definitely incorrect. The decimal value for the WAP Push port is 2948 (not 9200).

-bn