Bonjour à tous,
j'essaie de recevoir des sms depuis un gateway sms (2WaySms), dans leur doc
ils disent que lorsqu'il recoive un sms au numéro que j'ai enregistré chez eux, ils font un POST sur une url que j'ai ajouter sur mon compte chez eux (l'url de mon site test) : http://www.2-waysms.com/my/cp.php?op...&page=http_api
ils le montrent en php :
pour tester, dans ma jsp j'ai uniquement mis cela :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 <?php $token = $_REQUEST['token']; // the authentication token; $from = $_REQUEST['from']; // the sender's phone number; $to = $_REQUEST['to']; // the receiver's phone number; $mid = $_REQUEST['mid']; // ID of the message in our network; $text = $_REQUEST['text']; // the body of the message; if(!in_array($_SERVER['REMOTE_ADDR'],array('144.76.18.242','78.46.106.211','78.46.106.219'))) { die("Error: Unknown IP"); } echo "Thank you $sender for sending $message"; ?>
Mais cela ne fonctionne pas, les strings sont à null.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 <% String token = ""; String from = ""; String text = ""; String to = ""; String mid = ""; token = request.getParameter("token"); from = request.getParameter("from"); to = request.getParameter("to"); mid = request.getParameter("mid"); text = request.getParameter("text"); out.println("<p>"+ token + " " + from + " " + to + " " + mid + " " + text +"</p>"); %>
Partager