How to recieve a xml response from jazz server using qt?
I want to get a response from the server. I am making a rest api request using "Qt C++" framework. I am able to connect to the server but not able to get the response.
The code details in qt are:
"auto status = connect(manager, &QNetworkAccessManager::finished,
this, &MyObject::ReplyFinished);
qDebug() << "Connection status:" << status;
manager->get(QNetworkRequest(QUrl("www.jazz.net")));
}
void MyObject::ReplyFinished(QNetworkReply reply) {
QString answer = reply->readAll();
qDebug() << answer;
QApplication::quit();
}
int main(int argc, char argv[]) {
auto *app = new QApplication(argc, argv);
auto myObject = new MyObject(app);
myObject->TestConnection();
return QApplication::exec();
}
The output is:
Connection status: true
qt.tlsbackend.ossl: Failed to load libssl/libcrypto.
"" //The response is empty
Accepted answer
If you try to start using a framework that you do not know against an API that you do not know, try to use something that works first. Here what all my peers do:
- Use Firefox and install RESTClient into it.
- Use Firefox to log into the Jazz Application (the RESRTClient inherits the authentication)
- Open RESTClient in Firefox
- GET (or whatever method) the URI of the API you are interested in.
If you get stuff back in RESTClient but not in your framework, it is likely your framework. Visit forums that are related to your framework to get it working.
The URI <jazz-server-public-uri-root>/rm/service seems to be an internal API.
I tried against a local server and I can access e.g. https://elm.example.com:9443/rm/service with RESTClient. So unless your server is dead, it is your framework that does not work for you.
Comments
PS:
qt.tlsbackend.ossl: Failed to load libssl/libcrypto
Indicates to me that SSL/TLS is not working and that could be the reason for not getting anything back.
https://elm.example.com:9443/rm/service is also a web page and returns HTML and NOT XML.
Thanks for your support.
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Aug 17 '22, 2:26 a.m.Kirti Rawal
Aug 17 '22, 2:28 a.m.i am using https://jazz-xxx.xxx/rm1/service url it is not giving response.