簡體   English   中英

實施UPnP iOS示例時出錯?

[英]Error in implementing the UPnP iOS sample?

我正在iOS中進行UPnP設備實現的工作,並且已經從此處下載了源代碼。 使用該示例,我能夠發現網絡上的UPnP設備,但是當我嘗試獲取設備的描述時,我遇到了一個問題。我沒有更改默認代碼中的任何內容,但仍然遇到了這個問題。

請求:

<?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>

響應:

錯誤(SoapAction):非200響應:500。數據:

<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>

有人可以建議我如何解決這個問題嗎?

不知道這是否可以解決您的問題,但是就在幾天前,我發現Windows中的默認換行符為“ \\ r \\ n”(ascii 13和10),而iOS中的默認換行符為“ \\ n”(ascii僅10個)。

這導致某些UPnP實現無法響應我的搜索請求。 對於換行符,UPnP標准通常要求使用“ \\ r \\ n”。 您可能需要查看實際的字節,看看13和10是否始終在一起,或者只得到10。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM