2015-04-05 35 views
2

我無法連接到我的服務器波什,它說,它需要 「SID」:如何將sid添加到XMPPBOSHConnection?

org.igniterealtime.jbosh.BOSHException: Connection Manager session creation response did not include required 'sid' attribute

這就是我正在嘗試連接/登錄:

 BOSHConfiguration.Builder configBuilder = BOSHConfiguration.builder(); 
     configBuilder.setUsernameAndPassword(USERNAME, PASSWORD); 
     configBuilder.setHost(HOST); 
     configBuilder.setPort(PORT); 
     configBuilder.setFile(FILE_PATH); 
     configBuilder.setUseHttps(true); 
     configBuilder.setServiceName(SERVICE); 
 AbstractXMPPConnection connection = new XMPPBOSHConnection(configBuilder.build()); 

try { connection.connect(); } catch (SmackException e) {

回答

0

我有同樣的問題,當我加入以下代碼解析:

Bytestream stream = new Bytestream(); 
stream.setSessionID(username); 
configBuilder.setResource(stream.toXML().toString()); 
+0

你把「username」作爲會話字符串是什麼? – sorinLates 2015-04-17 12:09:41

+0

無法使其工作仍然是相同的錯誤:「連接管理器會話創建響應不包括所需的'sid'屬性」。 你能指點我一些資源,所以我可以弄明白嗎? – sorinLates 2015-04-17 12:16:08