WSP Headers (wap push)

WSP Headers (wap push) SearchSearch
Author Message
Frank Jonson
New member
Username: Frank17

Post Number: 1
Registered: 01-2009
Posted on Thursday, January 08, 2009 - 10:45 pm:   

Hello, I have a question about wsp headers for wap push.

Currently I have two different packages, the first is:

02 06 05 ae 8d c7 c3 93

02 is supposed to be the TID
06 is push
05 is the length of it (ae, 8d, c7, c3, 93 = 5 so far so good)
ae what is this? the content type should be 2E (according to wina application/vnd.wap.sic) but why the bit 8 is set?
then the rest 8d, c7, c3 and 93 I can't find them on wsp specs.

The second is (with authentication):

00 06 10 ae 87 09 80 66 6f 6f 00 62 61 72 00 8d c7 c3 93

00, 06, 10 is same as above, I understand those.
ae same problem
87 according to table 39 of the wsp specs 7 is authorization, again I don't know why the 8th bit is set.
09 I supposed this is the length of the authorization (80 66 6f 6f 00 62 61 72 00) which makes sense since 66 6f 6f was my username, 62 61 72 my password) the first 80 means it was authorized right? and then null terminated strings for user/password.

Then 8d c7 c3 93, is 8d content length (table 39) again why the 8th bit is set?

In both cases my question is for:
8d c7 c3 93
is 8d = 0x0d (content-length) if so then c7 should be the total length, since both are the same data, 0xc7 = 199 my data size is 71, if I set bit 8 off in 0xc7 I get 0x47 = 71

c3 with 8th bit off is 0x43 encoding version, so 93 must be 1.3? without 8th bit it is 0x13...

According to WSP Spec the 8th bit is set for variable length integer octet (8.1.2) but it seems to be used in other parts too.

Any lights on this issue will be extremely appreciated!

Thanks
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 364
Registered: 08-2008
Posted on Friday, January 09, 2009 - 10:17 pm:   

Regarding why the 8th bit set, refer to Section 8.4.1 Header Encoding - General in the WSP specification.

I guess it's not really clear in there, but it has some explanation about different ranges of values.

Next, look at 8.4.2.6 which defines the rules for encoding a header.

If a "Message-header" is a "Well-known-header" (meaning it has a short binary value number assigned), then the header part is encoded as "Well-known-field-name", which is encoded as "Short-integer". For "Short-integer", the high bit is always set.

WSP is complicated, but pretty well defined. This will probably be enough of a clue to help you sort things.

I'm not sure why you're including a "Content-length:" header. As the spec indicates, it is already implied by the length of the PDU ... and this header would normally only be used in response to an HTTP HEAD request. You would not normally set it in WAP push PDU.

The "Authorization:" header you refer to ... the "80" means "basic". (See 8.4.2.14 and 8.4.2.5.)

--
Des
NowSMS Support