openfire消息档案管理中的服务不可用错误 [英] service unavailable error in openfire message archive management

查看:703
本文介绍了openfire消息档案管理中的服务不可用错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有openfire 4.2.0的监控插件1.6.0。

I am using monitoring plugin 1.6.0 with openfire 4.2.0.

以下是openfire管理控制台上存档设置的屏幕截图。

Following is the screenshot of archive settings on openfire admin Console.

以下是我正在使用的插件的屏幕截图。

also following is the screenshot of plugins I am using with this.

我的问题

您可以看到插件已安装。
,但当我尝试使用以下代码获取聊天记录时:我收到服务不可用的响应。

as you can see the plugin is installed. but when I am trying to fetch chat history with following code : I am getting service unavailable response.

func fetchChatHistoryFromServer(completionHandler completion: @escaping FetchChatHistoryCompletionHandler) {

    let iq = DDXMLElement(name: "iq")
    iq.addAttribute(withName: "type", stringValue: "set")
    iq.addAttribute(withName: "id", stringValue: UserManager.shared.activeUser.jid)

    let query = DDXMLElement(name: "query")
    query.setXmlns("urn:xmpp:mam:2")
    query.addAttribute(withName: "queryid", stringValue: XMPPManager.shared.xmppStream.generateUUID)

    let x = DDXMLElement(name: "x")
    x.setXmlns("jabber:x:data")
    x.addAttribute(withName: "type", stringValue: "submit")


    let field = DDXMLElement(name: "field")
    field.addAttribute(withName: "var", stringValue: "FORM_TYPE")
    field.addAttribute(withName: "type", stringValue: "hidden")
    let fieldValue = DDXMLElement(name: "value", stringValue: "urn:xmpp:mam:2")
    field.addChild(fieldValue)
    x.addChild(field)
    query.addChild(x)
    iq.addChild(query)
    //let xmppResultSet = XMPPResultSet(max: 2000)
    Logger.log(iq)
    didFetchChatHistoryCompletionBlock = completion
    xmppMessageArchivingManagement?.retrieveMessageArchive(withFields: [iq], with: nil)
}

OutPut日志: -

OutPut Log :-

<iq type="set" id="dev60@dev.myapp.com">
    <query xmlns="urn:xmpp:mam:2" queryid="20B07616-12BC-41BB-9DE6-F0F6A74951A5">
        <x xmlns="jabber:x:data" type="submit">
            <field var="FORM_TYPE" type="hidden">
                <value>urn:xmpp:mam:2</value>
            </field>
        </x>
     </query>
</iq>

回复: -

<iq xmlns="jabber:client" type="error" id="7BED0303-46E3-40D4-BE47-543BB7810F66" to="dev60@dev.myapp.com/a3lb3jaw9g">
<query xmlns="urn:xmpp:mam:2" queryid="80D6D753-B2BF-4626-84B5-C216D4B94996">
    <x xmlns="jabber:x:data" type="submit">
        <field var="FORM_TYPE" type="hidden">
        <value>urn:xmpp:mam:2</value>
        </field>
        <iq type="set" id="dev60@dev.myapp.com">
            <query xmlns="urn:xmpp:mam:2" queryid="20B07616-12BC-41BB-9DE6-F0F6A74951A5">
                <x xmlns="jabber:x:data" type="submit">
                    <field var="FORM_TYPE" type="hidden">
                        <value>urn:xmpp:mam:2</value>
                    </field>
                </x>
            </query>
        </iq>
    </x>
</query>
<error code="503" type="cancel">
    <service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"></service-unavailable>
</error>

推荐答案

openfire不支持 urn:xmpp:mam:2 你必须使用 urn:xmpp:mam:1 相反。
你必须在XMPPMessageArchiveManagemnt类中更改它。
只需转到XMPPMessageArchiveManagement类。在20行中它表示
/ **'urn:xmpp:mam:2'* / extern NSString * const XMLNS_XMPP_MAM;
只需按住命令并在更改后单击XMLNS_XMPP_MAM urn:xmpp:mam:2 urn:xmpp:mam:1

openfire do not support urn:xmpp:mam:2 you have to use urn:xmpp:mam:1 instead. you have to change it in XMPPMessageArchiveManagemnt class. just go to XMPPMessageArchiveManagement class .in line of 20 it said /** 'urn:xmpp:mam:2' */ extern NSString *const XMLNS_XMPP_MAM;. just hold command and click on XMLNS_XMPP_MAM after that change urn:xmpp:mam:2 to urn:xmpp:mam:1

这篇关于openfire消息档案管理中的服务不可用错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆