Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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
    



0 votes

Comments
  1. I would suggest you post to a QT forum.
    2.  www.jazz.net is not a URL you should use in your automation. It is a Web Page and not an API endpoint.

i am using https://jazz-xxx.xxx/rm1/service url it is not giving response.


Accepted answer

Permanent link

 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:


  1. Use Firefox and install RESTClient into it.
  2. Use Firefox to log into the Jazz Application (the RESRTClient inherits the authentication)
  3. Open RESTClient in Firefox
    1. 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.

Kirti Rawal selected this answer as the correct answer

1 vote

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.

 

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 87
× 31
× 1

Question asked: Aug 17 '22, 1:33 a.m.

Question was seen: 2,213 times

Last updated: Oct 14 '22, 4:20 a.m.

Confirmation Cancel Confirm