I am playing about with bubbleUpnp and looking at uPnp in general. I've put out a urn:schemas-upnp-org:device:MediaRenderer:1 discovery and the app notifies of its capabilities.
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).
trying to get set a AVTransportURI on bubbleUpnp i keep getting a uPnp error
<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 ?
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).
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.