pubsub 서비스에서 제공하는 항목을 검색하려고합니다. 대상 서버에 로그인하면 응답을 성공적으로 가져올 수 있습니다. 하지만 부에 로그인 할 때 연결하지 않으면 잘못된 요청 오류가 발생합니다.로그인하지 않고 스맥 서비스를 검색하면 잘못된 요청이 발생 함 (400)
이 코드입니다 :
ConnectionConfiguration config = new ConnectionConfiguration(serverAddress, 5222);
config.setServiceName(serviceName);
connection = new XMPPConnection(config);
connection.connect();
connection.login(userName, password); //!!!when I remove this line, bad request error is received
ServiceDiscoveryManager discoManager = ServiceDiscoveryManager.getInstanceFor(connection);
DiscoverItems items;
try {
items = discoManager.discoverItems("pubsubservice." + serverName);
} catch (XMPPException e) {
e.printStackTrace();
}
사용자가 로그인하지 않은 항목을 발견 할 수있는 방법이 있나요하지만 연결이 설정됩니다?