/** *This method calls ICat api logout and disconnects from ICat DB * @returns zero if successful otherwise error code */ int CICatHelper::doLogout() { ICATPortBindingProxy icat; setICATProxySettings(icat); ns1__logout request; ns1__logoutResponse response; std::string sessionID = m_session->getSessionId(); request.sessionId = &sessionID; int ret = icat.logout(&request, &response); if (ret != 0) { throw std::runtime_error( "You are not currently logged into the cataloging system."); } m_session->setSessionId(""); return ret; }
/** * Disconnects the client application from ICat4 based catalog services. */ void ICat4Catalog::logout() { ICATPortBindingProxy icat; setICATProxySettings(icat); ns1__logout request; ns1__logoutResponse response; std::string sessionID = m_session->getSessionId(); request.sessionId = &sessionID; int result = icat.logout(&request, &response); if (result == 0) { m_session->setSessionId(""); } else { throwErrorMessage(icat); } }