I am trying to implement UPnP AV control point. i completed till description phase of the architecture. To get the contents of the server from browse action, I am using CURL command as below.
curl -o response.xml -H "Host: 192.168.1.47:2869" -H "Content-Type: text/xml; Charset="UTF-8"" -H "SOAPAction: "http://192.168.1.47:2869/upnphost/udhisapi.dll?content=uuid:67240e36-10e0-45f6-9c4b-e18cdd53360e"" -d @request.xml -X POST http://192.168.1.47:2869/upnphost/udhisapi.dll?control=uuid:99261858-3c45-41b5-87fd-3f30b4700005+urn:upnp-org:serviceId:ContentDirectory
The URL under SOAPAction is the service description url of the server. The URL after POST is the control URL of the server.
My request.xml is as below:
<?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:Browse xmlns:u="urn:schemas-upnp-org:Service:ContentDirectory:1">
<ObjectID>"0"</ObjectID>
<BrowseFlag>"BrowseDirectChildren"</BrowseFlag>
<Filter>"*"</Filter>
<StartingIndex>0</StartingIndex>
<RequestedCount>3</RequestedCount>
<SortCriteria>""</SortCriteria>
</u:Browse>
</s:Body>
</s:Envelope>
`
The response XML that I get does not contain the body content that i require. The response xml is:
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError>
<errorCode>401</errorCode>
<errorDescription>Invalid Action</errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
How do I get the contents of the server.
Soapaction should be the fully specified identifier of the action you want to call. You are sending a URL to the service description instead. The following should work better:
SOAPACTION: "urn:schemas-upnp-org:service:ContentDirectory:1#Browse"
Your xml may also be invalid, the angle brackets don't seem to match. I would also check the quoting of the Browse argument values: I believe none of them should be quoted.