ok, let me be very explicit.

I presently have a form with the following fields for clients to submit data:
        1. mobile numbers (either single or bulk. ie uploading a text file. 
numbers are separated by ",")
        2. Sender's Name
        3. SMS message
then i send with the following cfhttp code:

 <cfhttpparam type="body" value="This is a URL variable">
</cfhttp>
 this works perfectly.


But i noticed that if i send to more that 100 numbers, the SMS is not 
delivered. Maybe something about amount of characters the address bar can hold.


So, i was asked to submit via XML POST formatted like this:

<SMS>
<authentification>
<username></username>
<password></password>
</authentification>
<message>
<sender></sender>
<text></text>
</message>
<recipients>
<gsm messageId=“clientmsgID1“></gsm>
<gsm messageId=“clientmsgID2“></gsm>
<gsm messageId=“clientmsgID3“></gsm>
<gsm messageId=“clientmsgID4“></gsm>
</recipients>
</SMS>

Now this is the huddle i need to scale. Someone gave me a cURL code, but its in 
PHP.:


<?php


// Saint Tosins version of Curl for infobip

// for your own sms gateway copy, call 08035898361



$request = ""; //initialize the request variable

$param["user"] = "$username"; 

$param["password"] = "$password"; 

$param["SMSText"] = "$message"; //this is the message that we want to send

$param["GSM"] = "$numbers"; //these are the recipients of the message

$param["sender"] = "$sender"; //this is our sender

$param["IsFlash"] = "0"; //we want to send the message via global route

$param["type"] = "LongSMS"; //message type is plain text



foreach($param as $key=>$val) //traverse through each member of the param array

{ 

  $request.= $key."=".urlencode($val); //we have to urlencode the values
  
  $request.= '&'; //append the ampersand (&) sign after each paramter/value pair

}


  $len = strlen($request)-1;

  $request = substr($request, 0, $len); //remove the final ampersand sign from 
the request



  $url = "http://www.infobip.com/Addon/SMSService/SendSMS.aspx";;



  
$ch = curl_init(); //initialize curl handle 

  curl_setopt($ch, CURLOPT_URL, $url); //set the url

  curl_setopt($ch, CURLOPT_HEADER, 0);  //header param

  curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); //return as a variable 

  curl_setopt($ch, CURLOPT_POST, 1); //set POST method 

  curl_setopt($ch, CURLOPT_POSTFIELDS, $request); //set the POST variables

  $response = curl_exec($ch); //run the whole process and return the response

  curl_close($ch); //close the curl handle



?>

Well all these codes have managed to mess up my head. So i called for instant 
help and will not mind giving $20 to the guide that will make it work.

Happy Hunting!
Sincerely, 
Chuka I.W. Anene
Chief Software Eng./CEO
Quorium Solutions 
www.quorium.org
07029609185,07032696113




________________________________
From: Dave Watts <dwa...@figleaf.com>
To: cf-talk <cf-talk@houseoffusion.com>
Sent: Mon, October 26, 2009 11:33:07 PM
Subject: Re: XML POST with Coldfusion


> i said via HTTP GET. i havent been able to send via XML post. That is why we 
> are having this discussion in the first place. Dont
> worry, the server has over 9000 clients, this means that their service works.

I think you missed my point. If you're not sure whether you're
building your POST correctly in CF, you can test sending an HTTP POST
directly using any number of HTTP test tools, or using telnet, and see
what kind of response you get. That will let you determine whether (a)
the service even accepts HTTP POST, (b) your XML is malformed or not
what the service expects, or (c) you're having a specific issue with
CF sending the data, as opposed to the format of the data itself.

But in any case, you will need to learn how to help yourself. You
simply aren't providing enough information for anyone else to help
you.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:327726
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to