Tip: Use XML to Send SMS Messages
By Nicholas Chase2005-04-11
SMAP messages
The heart of an MMAP transaction is the actual message to be passed, which gets expressed as an SMAP message. The SMAP protocol was developed on the theory that when compared to the binary form that SMS messages currently take, this XML-based format is more interoperable in the short-term and easier to convert to other formats later on, if necessary.
When it comes to structure, a simple SMAP text message to be passed to a phone has much in common with a SOAP message.
Listing 1. SMAP text message
The SMAP text message consists of a header, which contains meta information (such as the destination for the message), and the body, which contains the actual message.
<SMAP:SubmitRequest
xmlns:SMAP="http://www.smsforum.net/schemas/smap/v1.0"
xsi:schemaLocation="http://www.smsforum.net/schemas/smap/v1.0
http://www.smsforum.net/schemas/smap/v1.0/smap.xsd">
<SMAP:ShortMessage>
<SMAP:Header>
<SMAP:Destination>
<SMAP:Number>5555309</SMAP:Number>
</SMAP:Destination>
</SMAP:Header>
<SMAP:Body>
<SMAP:Text>Jenny, I've got your number.</SMAP:Text>
</SMAP:Body>
</SMAP:ShortMessage>
</SMAP:SubmitRequest>
<body>
</body>
</html>
SMAP defines several operations, from sending a message to altering or cancelling a message that has been sent but not delivered.
Tutorial Pages:
» Reap the benefits of MMAP and SMAP
» What is SMS?
» SMAP messages
» A Simple MMAP Conversation
» Message Responses
» Other Options
» Resources
First published by IBM developerWorks
