How to Send a WAP Push Link through Named Pipe

This sample demonstrates how to send a WAP Push link using the named pipe of the Info service.

File SendWAPPushLink.vbs used in this sample is located in the folder:

    C:\Program Files\CodeSegment\SMS Studio\Samples\InfoService folder.

This script opens a named pipe instance and sends a messages that will be placed in the SMS Studio Outbox and sent accordingly.

How to run this sample

  1. Click the New button on the main toolbar and select the Info service option in the New Service dialog.
  2. Click the Setup button on the main toolbar to display the Info Setup dialog.
  3. In the Advanced tab enter the name of the pipe:
    Pipe name: WAPPushPipe
  4. Click the OK button to close the Info Setup dialog.
  5. Open Windows Explorer and locate the SendWAPPushLink.vbs file. Double-click on this file to run the script.
  6. Check the Outbox window to see that the message with a WAP Push link is being sent.

Source code

The contents of the SendWAPPushLink.vbs file:

'-------------------------------------------------------------------------------------------------------------------------------
' This script demonstrates how to send a WAP Push link using Info Service Named Pipe.
' After this script is executed a message will appear in the Outbox window.
' WARNING: Error checking omitted for clarity.
'-------------------------------------------------------------------------------------------------------------------------------

PipeName = "WAPPushPipe"                              ' Name of the pipe
                                                      ' This value must be specified in the Info Setup dialog

set fso = CreateObject("Scripting.FileSystemObject")
set pipe = fso.CreateTextFile("\\.\pipe\" & PipeName) ' Open the pipe instance

pipe.WriteLine("To: +1122334455")                     ' Recipient
pipe.WriteLine("From: 5555")                          ' Sender

pipe.WriteLine("AccountID: Emulator #1")              ' Account for sending
                                                      ' Account ID should be taken from the Edit Connection dialog
                                                      ' If the account and address (from) are not specified the message
                                                      ' will be sent using the default values from the Info Setup dialog

pipe.WriteLine("BodyType: WAP Push")                  ' Type is WAP Push
pipe.WriteLine("Body: http://wap.codesegment.com")    ' WAP Push URL
pipe.WriteLine("NewLine: CodeSegment")                ' WAP Push Title

pipe.WriteLine("<Send>")                              ' Send the message

pipe.Close                                            ' Close the pipe instance

WScript.Quit(0)                                       ' Exit

'-------------------------------------------------------------------------------------------------------------------------------
' Copyright (c) 2002-2009 CodeSegment. All rights reserved.                                          http://www.codesegment.com/
'-------------------------------------------------------------------------------------------------------------------------------

Related topics

Named Pipe

 

Copyright © 2002-2010 CodeSegment. All rights reserved.

   www.codesegment.com