[英]uPnp SetAVTransportURI Missing SOAP action header
I am playing about with bubbleUpnp and looking at uPnp in general. 我正在与bubbleUpnp一起玩,并且通常在看uPnp。 I've put out a urn:schemas-upnp-org:device:MediaRenderer:1 discovery and the app notifies of its capabilities.
我已经提出了urn:schemas-upnp-org:device:MediaRenderer:1发现,该应用会通知其功能。
The first issue is I have xmbc on different devices, ps3, ps4 all can see each other but only the bubbleUpnp and my router replies ( that goes for ssdp:all to). 第一个问题是我在不同的设备上安装了xmbc,ps3,ps4都可以互相看到,但是只有bubbleUpnp和我的路由器回复(ssdp:all可以)。
trying to get set a AVTransportURI on bubbleUpnp i keep getting a uPnp error 试图在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>
But grabbing the header from charles shows its there. 但是从查尔斯那里抢到头文件就可以看到它。
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
heres the soap request 这是肥皂的要求
<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>
and under the soap tab in charles it looks ok to me 在查尔斯的肥皂标签下,对我来说还可以
SetAVTransportURI Method
Parameters Element
[InstanceID: null] Element 0
[CurrentURI: null] Element http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4
[CurrentURIMetaData: null] Element
It could be my in experience with soap/upnp does anything stick out ? 这可能是我使用肥皂/ UPNP的经验吗?
Cheers 干杯
edit heres the code to send the request. 编辑此处的代码以发送请求。
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);
I can't promise this is the real issue but the SOAPAction value should be in doublequotes (don't ask me, I don't think it makes any sense either). 我不能保证这是真正的问题,但是SOAPAction值应该用双引号引起来(不要问我,我也不认为这有意义)。
Try something like this: 尝试这样的事情:
request.setRequestHeader("SOAPAction", "\"urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI\"");
In general I advice to check the actual messages on the network (wireshark is a great tool) and compare them to messages sent by a client that does work. 通常,我建议检查网络上的实际消息(wireshark是一个很好的工具),并将它们与工作的客户端发送的消息进行比较。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.