SOAPコマンドを発行します
//WeMaをSOAP経由で操作します。 var wemoHost = "192.168.10.6:49153"; var sw = 1; var url = "http://" + wemoHost + "/upnp/control/basicevent1"; var data = '<?xml version="1.0" encoding="utf-8"?>\n' + '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">\n' + ' <s:Body>\n' + ' <u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1">\n' + // 対象の Action を指定 ' <BinaryState>' + sw + '</BinaryState>\n' + // ON/OFF を 1/0 で指定 ' </u:SetBinaryState>\n' + ' </s:Body>\n' + '</s:Envelope>\n'; var appendHeader = {}; appendHeader['User-Agent'] = 'CyberGarage-HTTP/1.0'; // iPhone App と同じ User-Agent soap_action(url,"urn:Belkin:service:basicevent:1#SetBinaryState",data,appendHeader,5000);