【问题标题】:How to handle error from XMLRPC in iOS如何在 iOS 中处理来自 XMLRPC 的错误
【发布时间】:2017-08-16 10:47:01
【问题描述】:

我正在研究 Objective-C 和 Web 服务使用 XMLRPC

你能帮我如何处理以下错误并向用户显示正确的错误消息。

从 XMLRPC 以字符串格式收到此错误。

我的字符串:

<?xml version='1.0'?>
<methodResponse>
<fault>
<value><struct>
<member>
<name>faultCode</name>
<value><int>4</int></value>
</member>
<member>
<name>faultString</name>
<value><string>(u'Sorry, you are not allowed to access this document. Only users with the following access level are currently allowed to do that:\n- Administration/Settings\n\n(Document model: ir.module.module)', None)</string></value>
</member>
</struct></value>
</fault>
</methodResponse>

更新:

现在我正在使用 WPXMLRPC https://github.com/wordpress-mobile/wpxmlrpc

我无法处理这是字符串

(u'Sorry, you are not allowed to access this document. Only users with the following access level are currently allowed to do that:\n- Administration/Settings\n\n(Document model: ir.module.module)', None)

我的错误看起来像这样

【问题讨论】:

    标签: ios objective-c iphone xml-rpc


    【解决方案1】:

    【讨论】:

    • 谢谢你的链接,但我可以解析xml标签,我已经更新了我的答案,请检查并给我重播,如果你有任何解决方案。
    • 请注意,我们在此不鼓励仅提供链接的答案,它们可能会被审核队列标记为删除。如果您有关于 Stack Overflow 的答案,请将信息放在答案本身中,仅在必要时添加链接。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-05
    • 2019-08-26
    相关资源
    最近更新 更多