【发布时间】:2016-08-29 09:20:03
【问题描述】:
我正在使用bubbleUpnp 并查看一般的uPnp。我已经发布了一个 urn:schemas-upnp-org:device:MediaRenderer:1 发现,应用程序会通知它的功能。
第一个问题是我在不同的设备上安装了 xmbc,ps3、ps4 都可以互相看到,但只有 bubbleUpnp 和我的路由器回复(这适用于 ssdp:all to)。
尝试在 bubbleUpnp 上设置 AVTransportURI,但我不断收到 uPnp 错误
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
<errorCode>401</errorCode>
<errorDescription>No action by that name at this service. Missing SOAP action header.</errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
但是从 charles 那里抓取标题显示它在那里。
POST
/dev/9bfe134f-b027-52f3-ffff-ffffaae644dd/svc/upnp-org/AVTransport/
action HTTP/1.1 Host 192.168.1.65:58645 Accept */*
Accept-Encoding gzip, deflate Content-Length 429
Content-Type text/xml; charset=utf-8 Accept-Language en-us
soapaction urn:schemas-upnp-org:service:AVTransport:1#
SetAVTransportURI Connection keep-alive
User-Agent channelListingTest/1 CFNetwork/758.3.15 Darwin/15.4.0
这是肥皂请求
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:SetAVTransportURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">
<InstanceID>0</InstanceID>
<CurrentURI>http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4</CurrentURI>
<CurrentURIMetaData />
</u:SetAVTransportURI>
</s:Body>
</s:Envelope>
在查尔斯的肥皂标签下,我觉得还可以
SetAVTransportURI Method
Parameters Element
[InstanceID: null] Element 0
[CurrentURI: null] Element http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4
[CurrentURIMetaData: null] Element
这可能是我在使用 soap/upnp 方面的经验,有什么突出的吗?
干杯
编辑这里的代码以发送请求。
var request = new XMLHttpRequest();
request.open("POST", "http://192.168.1.65:58645/dev/9bfe134f-b027-52f3-ffff-ffffaae644dd/svc/upnp-org/AVTransport/action");
request.onreadystatechange = function() {
console.log(request.responseText)
};
let setAVTransport = '<?xml version="1.0" encoding="utf-8"?>' +
'<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">' +
'<u:SetAVTransportURI xmlns:u="urn:schemas-upnp-org:service:AVTransport:1">' +
'<InstanceID>0</InstanceID>' +
'<CurrentURI>http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4</CurrentURI>' +
'<CurrentURIMetaData></CurrentURIMetaData>' +
'</u:SetAVTransportURI>' +
'</s:Body>' +
'</s:Envelope>';
request.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
request.setRequestHeader("SOAPAction", "urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI");
request.send(setAVTransport);
【问题讨论】:
-
请按照线路上看到的完全相同的方式粘贴标题,目前无法判断它们是否正确(例如是否引用了肥皂动作值,或者它是否在一行中正确)跨度>
-
嗨,谢谢,这是代码 - 我认为这可能是我在开发机器上的网络设置,因为 kodi 没有看到任何东西(除了 bubbleupnp)。
标签: soap xmlhttprequest action upnp dlna