how to get xml from openmarket
Posted: Thu May 13, 2010 3:09 pm
I want to integrate open market into my website.I have this dummy code from open market integration guide.
but i don't know how i will capture sent xml to me by openmarket and parse that.
Here is scenerio.
1. I will send a sms using open market to my customer.
2. They will reply with Yes or No.
3. On the basis of their reply if yes is received I will send them more message otherwise no message will be send further.
Code: Select all
require_once("SMS.php"); $sms = new SMS();
// PHP "magic quotes" option will add slashes to FORM params
// which will cause a parsing error -- slashes need removed first
if (get_magic_quotes_gpc()) { $xml = stripslashes($_POST['xml']); } else { $xml = $_POST['xml']; }
// parse incoming xml and check if its a deliver request if ($sms->parse($xml) && $sms->isDeliver()) { echo "User Agent: " . $sms->getUserAgent() . "
\n"; echo "Ticket Id: " . $sms->getTicketId() . "
\n"; $source = $sms->getSourceAddr(); echo "Source Type: " . $source->getType() . "
\n"; echo "Source Address: " . $source->getAddress() . "
\n"; $dest = $sms->getDestinationAddr(); echo "Dest Type: " . $dest->getType() . "
\n"; echo "Dest Address: " . $dest->getAddress() . "
\n"; echo "Message Text: " . $sms->getMessageText() . "
\n"; } else { // handle invalid message } but i don't know how i will capture sent xml to me by openmarket and parse that.
Here is scenerio.
1. I will send a sms using open market to my customer.
2. They will reply with Yes or No.
3. On the basis of their reply if yes is received I will send them more message otherwise no message will be send further.