0

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

有人可以建议我如何解决这个问题吗?

4

1 回答 1

0

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.

于 2015-03-03T22:20:25.837 回答