[英]uPnp SetAVTransportURI Missing SOAP action header
我正在與bubbleUpnp一起玩,並且通常在看uPnp。 我已經提出了urn:schemas-upnp-org:device:MediaRenderer:1發現,該應用會通知其功能。
第一個問題是我在不同的設備上安裝了xmbc,ps3,ps4都可以互相看到,但是只有bubbleUpnp和我的路由器回復(ssdp:all可以)。
試圖在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>
但是從查爾斯那里搶到頭文件就可以看到它。
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
這可能是我使用肥皂/ 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);
我不能保證這是真正的問題,但是SOAPAction值應該用雙引號引起來(不要問我,我也不認為這有意義)。
嘗試這樣的事情:
request.setRequestHeader("SOAPAction", "\"urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI\"");
通常,我建議檢查網絡上的實際消息(wireshark是一個很好的工具),並將它們與工作的客戶端發送的消息進行比較。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.