On 10/25/07, nxs_02 <[EMAIL PROTECTED]> wrote:
>
>
> i has added "\n\r" but it still not working. error messages that i
> received
> is "Unable to parse mime content" and "error preamble". anyone can help
> me.
> here is my source code.
>
> <?php
> echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>";
> echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\"
> \"http://www.wapforum.org/DTD/wml_1.2.xml\";>";
>
>         $msisdn = "+6281392xxxxx";
>         $txt = "Anda Mandapat Pesan";
>         $link = "http://www.chat2konco.com";;
>         $url = "http://127.0.0.1:8080/wappush";;
>         $msisdn_pap = rawurldecode($msisdn);
>         $txt_pap = htmlspecialchars(rawurldecode($txt));
>         $smsc_id = "l7";
>
>         $body = "--asdlfkjiurwgasf\r\n".
>                 "Content-type: application/xml\r\n\r\n".
>                 '<?xml version="1.0"?>'."\r\n".
>                 '<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 1.0
> //EN"'."\r\n".
>                 '"http://www.wapforum.org/DTD/pap_1.0.dtd";>'."\r\n".
>                 '<pap>'."\r\n".
>                         '<push-message push-id="ABC032"
> progress-notes-requested="false">'."\r\n".
>                                 '<address
> address-value=\"WAPPUSH='.$msisdn_pap.'/[EMAIL PROTECTED]
> \"/>'."\r\n".
>                                         '<quality-of-service
> priority="high" delivery-method="unconfirmed"
> network-required="true" bearer-required="true" network="GSM"
> bearer="SMS"/>'.
>                         "</push-message>\r\n".
>                 "</pap>\r\n\r\n".
>                 "--asdlfkjiurwgasf\r\n".
>                 "Content-type: text/vnd.wap.si\r\n\r\n".
>                 '<?xml version="1.0"?>'."\r\n".
>                 '<!DOCTYPE si PUBLIC "-//WAPFORUM//DTD SI 1.0
> //EN"'."\r\n".
>                 '"http://www.wapforum.org/DTD/si.dtd";>'."\r\n".
>                 "<si>\r\n".
>                         '<indication action="signal-medium"
> href="'.$link.'">'.$txt_pap.'</indication>'."\r\n".
>                 "</si>\r\n\r\n".
>                 "--asdlfkjiurwgasf\r\n";
>
>         $header[] = "MIME-Version: 1.0";
>         $header[] = "X-Kannel-SMSC: $smsc_id";
>         $header[] = "Content-type: multipart/related;
> boundary=--asdlfkjiurwgasf;
> type=application/xml";
>         $header[] = "Accept: text/xml";
>         $header[] = "Content-length: ".strlen($body);
>         $header[] = "Cache-Control: no-cache";
>         $header[] = "Connection: close \r\n";
>         $header[] = $body;
>
>         $ch = curl_init();
>         curl_setopt($ch, CURLOPT_URL,$url);
>         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>         curl_setopt($ch, CURLOPT_TIMEOUT, 5);
>         curl_setopt($ch, CURLOPT_CUSTOMREQUEST,'POST');
>         curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
>         $getResult = curl_exec($ch);
>
>         curl_close($ch);
> ?>
> --
> View this message in context:
> http://www.nabble.com/http-request-for-wap-push-tf4650767.html#a13400121
> Sent from the Kannel - User mailing list archive at Nabble.com.
>
>
>


-- 
Regards,

Ady Wicaksono
Email:
ady.wicaksono at gmail.com
http://adywicaksono.wordpress.com/

Reply via email to