I am desperate to try to send a message to my TV.
I have read many articles on the forums but I still can not send a message. I understood that he had to use the messageboxservice. I followed all the tutorial posted on the forum (and other SamyGo) but nothing.
I tried setting my network (IP, port), I tried to send a message using sms4TV software successfully so I do not understand.
My idea is to send message via PHP (from NAS device) so I find this one source language.
Here is the source code for my program.
Has anyone succeeded in sending a message to the TV?
Please help me. Thanks a lot
Bilouz
Code: Select all
<?php
// Adress of Service Web of my TV ** Tested OK
$post_url = "http://192.168.0.15:52235/PMR/control/MessageBoxService";
// Body of xml information to post
$xml_builder ="<?xml version="1.0" encoding="utf-8"?>
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" >
<s:Body>
<u:AddMessage xmlns:u="urn:samsung.com:service:MessageBoxService:1\">
<MessageType>text/xml</MessageType>
<MessageID>0</MessageID>
<Message>
<Category>SMS</Category>
<DisplayType>Maximum</DisplayType>
<ReceiveTime>
<Date>2010-05-04</Date>
<Time>01:02:03</Time>
</ReceiveTime>
<Receiver>
<Number>12345678</Number>
<Name>Receiver</Name>
</Receiver>
<Sender>
<Number>11111</Number>
<Name>Sender</Name>
</Sender>
<Body>Hello World!!!</Body>
</Message>
</u:AddMessage>
</s:Body>
</s:Envelope>";
$ch = curl_init($post_url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_builder);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_REFERER, 'http://www.bharath..co.uk');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$ch_result = curl_exec($ch);
curl_close($ch);
// Print CURL result.
echo $ch_result;
?>