I am close to figuring out how to control my SONY STR-DA5500ES receiver via IP.
For testing I am trying to write a simple html page with an on/off button and volume up/down.
I have been able to turn the device on and off successfully via IP by using a uPnP developer tool to write the appropriate code to the device.
I was able to use wireshark to capture the network traffic (a SOAP command) which is below.
The CISDATA parameter is the appropriate control code from list of commands (volume/up/down on/off etc).
At the bottom is the javascript function I ended up with to try to generate that SOAP command.
The HTML code does not seem that complicated, but I am at a loss to get it working.
Is there an easier method? I have little to no HTML programming experience - so it may be something simple I am missing.
Any help or suggestions would be appreciated.
Thanks
Dennis
POST /upnp/control/CIS HTTP/1.1
HOST: 192.168.0.100:8888
SOAPACTION: "urn:schemas-sony-com:service:X_CIS:1#X_CIS_Command"
CONTENT-TYPE: text/xml; charset="utf-8"
Content-Length: 344
<!--?xml version="1.0" encoding="utf-8"?-->
<s:envelope s:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="
[Link: schemas.xmlsoap.org]">
<s:body>
<u:x_cis_command xmlns:u="urn:schemas-sony-com:service:X_CIS:1">
<cisdata>0202A0213D
Here is the JavaScript Function I came up with, it doesn't quite work, i think it has to do with the headers. :function soap() {
var objXMLHttpRequest = new XMLHttpRequest();
objXMLHttpRequest.open("POST", "
[Link: 192.168.0.100] ", true);
// build SOAP request
var packet = '<!?xml version="1.0" encoding="utf-8"?>'+
'<s:envelope br="" s:body="" s:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="
[Link: schemas.xmlsoap.org]">'<
+
'<u:x_cis_command xmlns:u="urn:schemas-sony-com:service:X_CIS:1">'+
'<cisdata>0202A0213D'</cisdata>'+
'</s:body>'+
'<s:envelope>';
// set SOAP headers
objXMLHttpRequest.setRequestHeader("SOAPACTION", "urn:schemas-sony-com:serviceId:X_CIS:1#X_CIS_Command");
objXMLHttpRequest.setRequestHeader("CONTENT-TYPE", "text/xml; charset=utf-8");
// send SOAP request
objXMLHttpRequest.send(packet);
}
Last edited by d_gatorfan on February 14, 2013 23:17.