I'm trying to figure out how to post a SOAP request with Hollywood. I figured I should do this using the hURL plugin. My overall goal is to write Sonos controller app for the Amiga, but let's take one step at a time, shall we?
This is want I'd like to achieve:
Method: POST
URL: http://192.168.1.227:1400/MediaRenderer ... rt/Control
Headers:
Content-Type = text/xml
SOAPACTION = urn:schemas-upnp-org:service:AVTransport:1#Play
XML-Data:
Code: Select all
<?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/">
<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> And this is what I tried with Hollywood:
Code: Select all
Function Play()
Local body$ = "<?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/\"><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>"
form = hurl.Form();
form:addcontent("BODY", body$, "text/xml")
e = hurl.Easy()
e:setopt_url("http://192.168.1.227:1400/MediaRenderer/AVTransport/Control")
e:setopt_httpheader({ "SOAPACTION" = "urn:schemas-upnp-org:service:AVTransport:1#Play"});
e:setopt_httppost(form);
e:perform()
form:free();
EndFunctionThis piece of code does run without errors but doesn't show any effect on my Sonos device at 192.168.1.227.
I'm grateful for any advice anyone can give me.
Greetings,
Michael