This is a sample module that demonstrates how to send a message through TeleMessage's xml interface from your visual basic code.
The module posts XML string (that represent a message) to our servers and get response about the sent message.
The response include message-id and message-key for tracking message delivery.
Note: The module references the MSXML library, therefore you should add reference to 'Microsoft XML, version 2.0'.
| |
Sub main()
|
| |
 |
Dim objHTTP As New MSXML.XMLHTTPRequest
Dim strMessage As String
Dim strReturn As String
Dim objReturn As New MSXML.DOMDocument
'Create the string to send
strMessage = "enter your XML message here" (see XML templates)
'Set up to post to our server
objHTTP.open("post", "http://xml.telemessage.com/partners/xmlMessage.jsp", False)
'Set a standard XML header for the content-type
objHTTP.setRequestHeader("Content-Type", "text/xml")
'Send the message
objHTTP.send(strMessage)
'Get the return response
strReturn = objHTTP.responseText
'Load the return response into a DOM
objReturn.loadXML(strReturn)
'Write the return response
Console.WriteLine(strReturn)
|
| |
End Sub
|
|