Error in implementing the UPnP iOS sample?

414 views Asked by At

I working on UPnP device implementation in iOS and I have downloaded the source code from here. Using the sample I am able to discover the UPnP devices on the network but when I try to fetch the description of the device I am getting an issue.I have not changed anything in the default code still I am getting this issue.

Request:

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body><u:GetSortCapabilities xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1">
</u:GetSortCapabilities></s:Body></s:Envelope>

Response:

Error (SoapAction): Got a non 200 response: 500. Data:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode>
<faultstring>UPnPError</faultstring><detail>
<u:UPnPError xmlns:u="urn:schemas-upnp-org:control-1-0">
<u:errorCode>801</u:errorCode>
<u:errorDescription>Access denied</u:errorDescription>
</u:UPnPError></detail>
</SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

Can anybody suggest me how to resolve this?

1

There are 1 answers

0
Curtis On

Not sure if this will fix your problem, but just a couple days ago, I discovered that the default newline in windows is "\r\n" (ascii 13 and 10) and the default newline in iOS is "\n" (ascii 10 only).

This caused some UPnP implementations to NOT respond to my search requests. The UPnP Standard requires "\r\n" in general for a newline. You may want to look at the actual bytes and see if 13 and 10 are always together, or if you're only getting the 10.