UPNP Curl SetVolume失败,出现<faultcode> s:Client </faultcode> errorCode -111

时间:2016-10-30 16:09:32

标签: curl soap upnp

我正在尝试通过wifi播放声音文件到iDeaUSA w205盒子。 到目前为止,一切都有效,除了音量设置,我只是不明白。

启动:工作

curl -H 'Content-Type: text/xml; charset=utf-8' -H 'SOAPAction: "urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI"' -d '
<?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:SetAVTransportURI
            xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
            <InstanceID>0</InstanceID>
            <CurrentURI>
                <![CDATA[http://192.168.178.46/naturesounds.ogg]]>
            </CurrentURI>
            <CurrentURIMetaData></CurrentURIMetaData>
        </u:SetAVTransportURI>
    </s:Body>
</s:Envelope>
' 'http://192.168.178.61:49152/upnp/control/rendertransport1'

玩:工作

curl -H 'Content-Type: text/xml; charset=utf-8' -H 'SOAPAction: "urn:schemas-upnp-org:service:AVTransport:1#Play"' -d '
<?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:Play
            xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
            <InstanceID>0</InstanceID>
            <Speed>1</Speed>
        </u:Play>
    </s:Body>
</s:Envelope>  
' 'http://192.168.178.61:49152/upnp/control/rendertransport1'

SetVolume:不工作

curl -H 'Content-Type: text/xml; charset=utf-8' -H 'SOAPAction: "urn:schemas-upnp-org:service:RenderingControl:1#SetVolume"' -d '
<?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:SetVolume xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1">
         <InstanceID>0</InstanceID>
         <Channel>Master</Channel>
         <DesiredVolume>12</DesiredVolume>
      </u:SetVolume>
   </s:Body>
</s:Envelope>
' 'http://192.168.178.61:49152/upnp/control/rendertransport1'

我不明白这一点,奇怪的是它正在与设备间谍一起使用来自开发人员工具的UPNP

这是我得到的错误,无论错误代码-111是什么,我都不知道。

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
<errorCode>-111</errorCode>
<errorDescription>Invalid Action</errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>

在这里,来自Spytool的嗅觉包括返回,在那里工作:

POST /upnp/control/rendercontrol1 HTTP/1.1
HOST: 192.168.178.61:49152
SOAPACTION: "urn:schemas-upnp-org:service:RenderingControl:1#SetVolume"
CONTENT-TYPE: text/xml; charset="utf-8"
Content-Length: 424

<?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:SetVolume xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1">
         <InstanceID>0</InstanceID>
         <Channel>Master</Channel>
         <DesiredVolume>12</DesiredVolume>
      </u:SetVolume>
   </s:Body>
</s:Envelope>HTTP/1.1 200 OK
CONTENT-LENGTH: 259
CONTENT-TYPE: text/xml; charset="utf-8"
DATE: Sun, 30 Oct 2016 15:54:42 GMT
EXT:
SERVER: Linux/2.6.21, UPnP/1.0, Portable SDK for UPnP devices/1.6.17

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>
<u:SetVolumeResponse xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1"></u:SetVolumeResponse>
</s:Body> </s:Envelope>
我是瞎了吗?差异在哪里,我只是没有看到它。我认为111是一些拒绝卷曲的连接然而这并不能解释为什么它是从工具而不是我的覆盆子pi(我实际上运行卷曲脚本)工作,也不是防火墙问题可能是因为前两个卷发做的。

编辑:解决方案:对于卷,它是rendercontrol1而不是rendertransport1

对于每个对此感兴趣的人,

正确的音量:

curl -H 'Content-Type: text/xml; charset=utf-8' -H 'SOAPAction: "urn:schemas-upnp-org:service:RenderingControl:1#SetVolume"' -d '<?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:SetVolume xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1"><InstanceID>0</InstanceID><Channel>Master</Channel><DesiredVolume>12</DesiredVolume></u:SetVolume></s:Body></s:Envelope>' 'http://192.168.178.61:49152/upnp/control/rendercontrol1'

除此之外,该设备喜欢为DNS打电话给一些中国网站。非常适合iDea“USA”;-)所以你可能想阻止它在你的路由器中回家。

0 个答案:

没有答案