Difference between revisions of "MessageBoxService request format"


From SamyGO
Jump to: navigation, search
(Created page with ''''Description of MessageBoxService service''' To be filled in.')
 
Line 1: Line 1:
'''Description of MessageBoxService service'''
+
=MessageBoxService SOAP request=
  
To be filled in.
+
In general, TV supports processing SOAP requests. Basic interface description can be downloaded from TV:
 +
 
 +
http://yourTV:52235/pmr/PersonalMessageReceiver.xml
 +
 
 +
  <?xml version="1.0" ?>
 +
  <root xmlns="urn:schemas-upnp-org:device-1-0">
 +
  <specVersion>
 +
    <major>1</major>
 +
    <minor>0</minor>
 +
  </specVersion>
 +
  <device>
 +
    <deviceType>urn:samsung.com:device:PersonalMessageReceiver:1</deviceType>
 +
    <friendlyName>TV</friendlyName>
 +
    <manufacturer>Samsung Electronics</manufacturer>
 +
    <manufacturerURL>http://www.samsung.com</manufacturerURL>
 +
    <modelDescription>Samsung DTV PMR</modelDescription>
 +
    <modelName>Samsung DTV PMR</modelName>
 +
    <modelNumber>1.0</modelNumber>
 +
    <modelURL>http://www.samsung.com</modelURL>
 +
    <serialNumber>...</serialNumber>
 +
    <UDN>uuid:...</UDN>
 +
  <serviceList>
 +
  <service>
 +
    <serviceType>urn:samsung.com:service:MessageBoxService:1</serviceType>
 +
    <serviceId>urn:samsung.com:serviceId:MessageBoxService</serviceId>
 +
    <controlURL>/PMR/control/MessageBoxService</controlURL>
 +
    <eventSubURL>/PMR/event/MessageBoxService</eventSubURL>
 +
    <SCPDURL>MessageBoxService.xml</SCPDURL>
 +
  </service>
 +
  </serviceList>
 +
  </device>
 +
  </root>
 +
 
 +
You can see, interface implements only one service MessageBoxService which description can be downloaded from:
 +
 
 +
http://yourTV:52235/pmr/MessageBoxService.xml
 +
 
 +
  <?xml version="1.0" encoding="utf-8" ?>
 +
  <scpd xmlns="urn:schemas-upnp-org:service-1-0">
 +
  <specVersion>
 +
    <major>1</major>
 +
    <minor>0</minor>
 +
  </specVersion>
 +
  <actionList>
 +
  <action>
 +
    <name>AddMessage</name>
 +
  <argumentList>
 +
  <argument>
 +
    <name>MessageID</name>
 +
    <direction>in</direction>
 +
    <relatedStateVariable>A_ARG_TYPE_MessageID</relatedStateVariable>
 +
  </argument>
 +
  <argument>
 +
    <name>MessageType</name>
 +
    <direction>in</direction>
 +
    <relatedStateVariable>A_ARG_TYPE_MessageType</relatedStateVariable>
 +
  </argument>
 +
  <argument>
 +
    <name>Message</name>
 +
    <direction>in</direction>
 +
    <relatedStateVariable>A_ARG_TYPE_Message</relatedStateVariable>
 +
    </argument>
 +
    </argumentList>
 +
  </action>
 +
  <action>
 +
    <name>RemoveMessage</name>
 +
    <argumentList>
 +
    <argument>
 +
      <name>MessageID</name>
 +
      <direction>in</direction>
 +
      <relatedStateVariable>A_ARG_TYPE_MessageID</relatedStateVariable>
 +
      </argument>
 +
    </argumentList>
 +
  </action>
 +
  </actionList>
 +
  <serviceStateTable>
 +
  <stateVariable sendEvents="no">
 +
    <name>A_ARG_TYPE_MessageID</name>
 +
    <dataType>string</dataType>
 +
  </stateVariable>
 +
  <stateVariable sendEvents="no">
 +
    <name>A_ARG_TYPE_MessageType</name>
 +
    <dataType>string</dataType>
 +
    <defaultValue>text/xml; charset="utf-8"</defaultValue>
 +
  </stateVariable>
 +
  <stateVariable sendEvents="no">
 +
    <name>A_ARG_TYPE_Message</name>
 +
    <dataType>string</dataType>
 +
  </stateVariable>
 +
  </serviceStateTable>
 +
  </scpd>
 +
 
 +
According to the "downloaded" content, the MessageBoxService should implement two actions - AddMessage and RemoveMessage. However, RemoveMessage does not seem to be implemented in TV, so let's forget about it for now.
 +
 
 +
 
 +
== Structure of AddMessage ==
 +
 
 +
Structure of the AddMessage is partially clear from the description, and it should have following format:
 +
 
 +
  <nowiki><u:AddMessage xmlns:u=\"urn:samsung.com:service:MessageBoxService:1\">
 +
    <MessageType>Body of MessageType</MessageType>
 +
    <MessageID>Body of MessageID</MessageID>
 +
    <Message>Body of Message</Message>
 +
  </u:AddMessage></nowiki>
 +
 
 +
 
 +
This XML structure is valid if:
 +
* Body of MessageType contains text "text/xml".
 +
* Body of MessageID does not seem to be checked, so it can contain anything.
 +
* Body of Message contains XML structure with message information.
 +
 
 +
 
 +
== Structure of Message ==
 +
 
 +
The most interesting thing is content of the Message body which specifies message sent to the TV.
 +
 
 +
Content of the Message is in fact XML structure, but with replaced "<" -> "&amp;lt;" and ">" -> "&amp;gt;".
 +
 
 +
For easier reading, in following XML structured I use "<" and ">" characters but before sending the request to the TV, don't forget to replace them by "&amp;lt;" and "&amp;gt;"!
 +
 
 +
 
 +
Message XML structure is parsed as following:
 +
 
 +
 
 +
  <Category>Body</Category>
 +
is checked to contain "SMS", "Incoming Call", "Schedule Reminder" and "MMS". However, "MMS" category is not implemented in TV.
 +
 
 +
 
 +
  <DisplayType>Body</DisplayType>
 +
is checked if contains "Maximum". If yes, detailed message is displayed on the TV, otherwise only short info is displayed.
 +
 
 +
 
 +
According to the Category type, different tags are used to retrieve content:
 +
 
 +
 
 +
=== "SMS" Category ===
 +
 
 +
  <ReceiveTime>
 +
    <Date>YYYY-MM-DD</Date> (YYYY - year, MM - month, DD - day)
 +
    <Time>HH:MM:SS</Time> (HH - hour, MM - minute, SS - second)
 +
  </ReceiveTime>
 +
  <Receiver>
 +
    <Number>Receiver Phone Number</Number>
 +
    <Name>Receiver Name</Name>
 +
  </Receiver>
 +
  <Sender>
 +
    <Number>Sender Phone Number</Number>
 +
    <Name>Sender Name</Name>
 +
  </Sender>
 +
  <Body>SMS Body</Body>
 +
 
 +
Sender and Body is displayed only in case DisplayType is set to "Maximum".
 +
 
 +
 
 +
=== "Incoming Call" Category ===
 +
 
 +
  <CallTime>
 +
    <Date>YYYY-MM-DD</Date> (YYYY - year, MM - month, DD - day)
 +
    <Time>HH:MM:SS</Time> (HH - hour, MM - minute, SS - second)
 +
  </CallTime>
 +
  <Callee>
 +
    <Number>Callee Phone Number</Number>
 +
    <Name>Callee Name</Name>
 +
  </Callee>
 +
  <Caller>
 +
    <Number>Caller Phone Number</Number>
 +
    <Name>Caller Name</Name>
 +
  </Caller>
 +
 
 +
Caller is displayed only in case DisplayType is set to "Maximum".
 +
 
 +
 
 +
=== "Schedule Reminder" Category ===
 +
 
 +
  <StartTime>
 +
    <Date>YYYY-MM-DD</Date> (YYYY - year, MM - month, DD - day)
 +
    <Time>HH:MM:SS</Time> (HH - hour, MM - minute, SS - second)
 +
  </StartTime>
 +
  <Owner>
 +
    <Number>Owner Phone Number</Number>
 +
    <Name>Owner Name</Name>
 +
  </Owner>
 +
  <Subject>Schedule Reminder Subject</Subject>
 +
  <EndTime>
 +
    <Date>YYYY-MM-DD</Date> (YYYY - year, MM - month, DD - day)
 +
    <Time>HH:MM:SS</Time> (HH - hour, MM - minute, SS - second)
 +
  </EndTime>
 +
  <Location>Location Name</Location>
 +
  <Body>Schedule Reminder Body</Body>
 +
 
 +
EndTime, Location and Body is displayed only in case DisplayType is set to "Maximum".
 +
 
 +
 
 +
== Sample Request ==
 +
 
 +
Sample SOAP request to display SMS message (without HTTP headers):
 +
 
 +
  <nowiki><?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>can be anything</MessageID>
 +
        <Message>
 +
          &amp;lt;Category&amp;gt;SMS&amp;lt;/Category&amp;gt;
 +
          &amp;lt;DisplayType&amp;gt;Maximum&amp;lt;/DisplayType&amp;gt;
 +
          &amp;lt;ReceiveTime&amp;gt;
 +
          &amp;lt;Date&amp;gt;2010-05-04&amp;lt;/Date&amp;gt;
 +
          &amp;lt;Time&amp;gt;01:02:03&amp;lt;/Time&amp;gt;
 +
          &amp;lt;/ReceiveTime&amp;gt;
 +
          &amp;lt;Receiver&amp;gt;
 +
          &amp;lt;Number&amp;gt;12345678&amp;lt;/Number&amp;gt;
 +
          &amp;lt;Name&amp;gt;Receiver&amp;lt;/Name&amp;gt;
 +
          &amp;lt;/Receiver&amp;gt;
 +
          &amp;lt;Sender&amp;gt;
 +
          &amp;lt;Number&amp;gt;11111&amp;lt;/Number&amp;gt;
 +
          &amp;lt;Name&amp;gt;Sender&amp;lt;/Name&amp;gt;
 +
          &amp;lt;/Sender&amp;gt;
 +
          &amp;lt;Body&amp;gt;Hello World!!!&amp;lt;/Body&amp;gt;
 +
        </Message>
 +
      </u:AddMessage>
 +
    </s:Body>
 +
  </s:Envelope></nowiki>

Revision as of 15:13, 11 May 2010

MessageBoxService SOAP request

In general, TV supports processing SOAP requests. Basic interface description can be downloaded from TV:

http://yourTV:52235/pmr/PersonalMessageReceiver.xml

 <?xml version="1.0" ?> 
 <root xmlns="urn:schemas-upnp-org:device-1-0">
 <specVersion>
   <major>1</major> 
   <minor>0</minor> 
 </specVersion>
 <device>
   <deviceType>urn:samsung.com:device:PersonalMessageReceiver:1</deviceType> 
   <friendlyName>TV</friendlyName> 
   <manufacturer>Samsung Electronics</manufacturer> 
   <manufacturerURL>http://www.samsung.com</manufacturerURL> 
   <modelDescription>Samsung DTV PMR</modelDescription> 
   <modelName>Samsung DTV PMR</modelName> 
   <modelNumber>1.0</modelNumber> 
   <modelURL>http://www.samsung.com</modelURL> 
   <serialNumber>...</serialNumber> 
   <UDN>uuid:...</UDN> 
 <serviceList>
 <service>
   <serviceType>urn:samsung.com:service:MessageBoxService:1</serviceType> 
   <serviceId>urn:samsung.com:serviceId:MessageBoxService</serviceId> 
   <controlURL>/PMR/control/MessageBoxService</controlURL> 
   <eventSubURL>/PMR/event/MessageBoxService</eventSubURL> 
   <SCPDURL>MessageBoxService.xml</SCPDURL> 
 </service>
 </serviceList>
 </device>
 </root>

You can see, interface implements only one service MessageBoxService which description can be downloaded from:

http://yourTV:52235/pmr/MessageBoxService.xml

 <?xml version="1.0" encoding="utf-8" ?> 
 <scpd xmlns="urn:schemas-upnp-org:service-1-0">
 <specVersion>
   <major>1</major> 
   <minor>0</minor> 
 </specVersion>
 <actionList>
 <action>
   <name>AddMessage</name> 
 <argumentList>
 <argument>
   <name>MessageID</name> 
   <direction>in</direction> 
   <relatedStateVariable>A_ARG_TYPE_MessageID</relatedStateVariable> 
 </argument>
 <argument>
   <name>MessageType</name> 
   <direction>in</direction> 
   <relatedStateVariable>A_ARG_TYPE_MessageType</relatedStateVariable> 
 </argument>
 <argument>
   <name>Message</name> 
   <direction>in</direction> 
   <relatedStateVariable>A_ARG_TYPE_Message</relatedStateVariable> 
   </argument>
   </argumentList>
 </action>
 <action>
   <name>RemoveMessage</name> 
   <argumentList>
   <argument>
     <name>MessageID</name> 
     <direction>in</direction> 
     <relatedStateVariable>A_ARG_TYPE_MessageID</relatedStateVariable> 
     </argument>
   </argumentList>
 </action>
 </actionList>
 <serviceStateTable>
 <stateVariable sendEvents="no">
   <name>A_ARG_TYPE_MessageID</name> 
   <dataType>string</dataType> 
 </stateVariable>
 <stateVariable sendEvents="no">
   <name>A_ARG_TYPE_MessageType</name> 
   <dataType>string</dataType> 
   <defaultValue>text/xml; charset="utf-8"</defaultValue> 
 </stateVariable>
 <stateVariable sendEvents="no">
   <name>A_ARG_TYPE_Message</name> 
   <dataType>string</dataType> 
 </stateVariable>
 </serviceStateTable>
 </scpd>

According to the "downloaded" content, the MessageBoxService should implement two actions - AddMessage and RemoveMessage. However, RemoveMessage does not seem to be implemented in TV, so let's forget about it for now.


Structure of AddMessage

Structure of the AddMessage is partially clear from the description, and it should have following format:

 <u:AddMessage xmlns:u=\"urn:samsung.com:service:MessageBoxService:1\">
    <MessageType>Body of MessageType</MessageType>
    <MessageID>Body of MessageID</MessageID>
    <Message>Body of Message</Message>
  </u:AddMessage>


This XML structure is valid if:

  • Body of MessageType contains text "text/xml".
  • Body of MessageID does not seem to be checked, so it can contain anything.
  • Body of Message contains XML structure with message information.


Structure of Message

The most interesting thing is content of the Message body which specifies message sent to the TV.

Content of the Message is in fact XML structure, but with replaced "<" -> "&lt;" and ">" -> "&gt;".

For easier reading, in following XML structured I use "<" and ">" characters but before sending the request to the TV, don't forget to replace them by "&lt;" and "&gt;"!


Message XML structure is parsed as following:


 <Category>Body</Category> 

is checked to contain "SMS", "Incoming Call", "Schedule Reminder" and "MMS". However, "MMS" category is not implemented in TV.


 <DisplayType>Body</DisplayType>

is checked if contains "Maximum". If yes, detailed message is displayed on the TV, otherwise only short info is displayed.


According to the Category type, different tags are used to retrieve content:


"SMS" Category

 <ReceiveTime>
   <Date>YYYY-MM-DD</Date>		(YYYY - year, MM - month, DD - day)
   		(HH - hour, MM - minute, SS - second)
 </ReceiveTime>
 <Receiver>
   <Number>Receiver Phone Number</Number>
   <Name>Receiver Name</Name>
 </Receiver>
 <Sender>
   <Number>Sender Phone Number</Number>
   <Name>Sender Name</Name>
 </Sender>
 <Body>SMS Body</Body>

Sender and Body is displayed only in case DisplayType is set to "Maximum".


"Incoming Call" Category

 <CallTime>
   <Date>YYYY-MM-DD</Date>		(YYYY - year, MM - month, DD - day)
   		(HH - hour, MM - minute, SS - second)
 </CallTime>
 <Callee>
   <Number>Callee Phone Number</Number>
   <Name>Callee Name</Name>
 </Callee>
 <Caller>
   <Number>Caller Phone Number</Number>
   <Name>Caller Name</Name>
 </Caller>

Caller is displayed only in case DisplayType is set to "Maximum".


"Schedule Reminder" Category

 <StartTime>
   <Date>YYYY-MM-DD</Date>		(YYYY - year, MM - month, DD - day)
   		(HH - hour, MM - minute, SS - second)
 </StartTime>
 <Owner>
   <Number>Owner Phone Number</Number>
   <Name>Owner Name</Name>
 </Owner>
 <Subject>Schedule Reminder Subject</Subject>
 <EndTime>
   <Date>YYYY-MM-DD</Date>		(YYYY - year, MM - month, DD - day)
   		(HH - hour, MM - minute, SS - second)
 </EndTime>
 <Location>Location Name</Location>
 <Body>Schedule Reminder Body</Body>

EndTime, Location and Body is displayed only in case DisplayType is set to "Maximum".


Sample Request

Sample SOAP request to display SMS message (without HTTP headers):

 <?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>can be anything</MessageID>
        <Message>
          &lt;Category&gt;SMS&lt;/Category&gt;
          &lt;DisplayType&gt;Maximum&lt;/DisplayType&gt;
          &lt;ReceiveTime&gt;
          &lt;Date&gt;2010-05-04&lt;/Date&gt;
          &lt;Time&gt;01:02:03&lt;/Time&gt;
          &lt;/ReceiveTime&gt;
          &lt;Receiver&gt;
          &lt;Number&gt;12345678&lt;/Number&gt;
          &lt;Name&gt;Receiver&lt;/Name&gt;
          &lt;/Receiver&gt;
          &lt;Sender&gt;
          &lt;Number&gt;11111&lt;/Number&gt;
          &lt;Name&gt;Sender&lt;/Name&gt;
          &lt;/Sender&gt;
          &lt;Body&gt;Hello World!!!&lt;/Body&gt;
        </Message>
      </u:AddMessage>
    </s:Body>
  </s:Envelope>