在iPhone中加入或创建房间时,XMPP MUC返回错误代码401
当我将创建房间的请求发送到在iPhone中加入或创建房间时,XMPP MUC返回错误代码401,iphone,ios,xcode,xmpp,Iphone,Ios,Xcode,Xmpp,当我将创建房间的请求发送到XMPP服务器(Openfire)时,我从服务器获取错误代码401。以下是相同项目的日志: "2013-09-03 09:47:56:298 ChatsIphone[7133:3e13] SEND: type="get" to="test2@conference.shan.com" id="CD5FD987-039D-47D8-AF97-83212E68B14E">query xmlns="http://jabber.org/protocol/muc#owner
XMPP服务器(Openfire)
时,我从服务器获取错误代码401
。以下是相同项目的日志:
"2013-09-03 09:47:56:298 ChatsIphone[7133:3e13] SEND: type="get" to="test2@conference.shan.com" id="CD5FD987-039D-47D8-AF97-83212E68B14E">query xmlns="http://jabber.org/protocol/muc#owner"/>
2013-09-03 09:47:56:299 ChatsIphone[7133:4a0f] SEND: presence to="test2@conference.shan.com/iphone1">x xmlns="http://jabber.org/protocol/muc"><password>iphone1/password>/x>x xmlns="vcard-temp:x:update">photo/>/x>c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://code.google.com/p/xmppframework" ver="VyOFcFX6+YNmKssVXSBKGFP0BS4="/>/presence>
2013-09-03 09:47:56:358 ChatsIphone[7133:4a0f] RECV: iq xmlns="jabber:client" type="error" id="CD5FD987-039D-47D8-AF97-83212E68B14E" from="test2@conference.shan.com" to="iphone1@shan.com/7cffdf9">query xmlns="http://jabber.org/protocol/muc#owner"/>error code="401" type="auth">not-authorized xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>/error>/iq>
谢谢,
Vaz请您将发送请求所用的代码张贴出来,好吗
XMPPJID *roomRealJid = [XMPPJID jidWithString:_userNameEdit.text];
XMPPRoom *newXmppRoom = [[XMPPRoom alloc] initWithRoomStorage:_appDelegate.xmppRoomStorage jid:roomRealJid dispatchQueue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0)];
[newXmppRoom activate: _appDelegate.xmppStream];
[newXmppRoom fetchConfigurationForm];
[newXmppRoom addDelegate:_appDelegate delegateQueue:dispatch_get_main_queue()];
[newXmppRoom joinRoomUsingNickname:_appDelegate.xmppStream.myJID.user history:nil password:@"iphone1"];
- (void)xmppRoomDidCreate:(XMPPRoom *)sender
{
[sender configureRoomUsingOptions:nil];
}