Has QNetworkAccessManager gone obsolete for 5.15.15?
-
Has use of HTTP REST API requests been deprecated over the last weekend? We have been making requests to our servers just fine prior. Starting this week no response comes from requests made using QT's QNetworkAccessManager. The HTTP requests no longer work on any current or previous version/build of our project.
I am working with QT 5.15.15 in Visual Studio on Windows 11.
Below is an example of how our server is communicated with.
bool readData(customStruct &info) { QEventLoop eventLoop; QObject::connect(&mgr, SIGNAL(finished(QNetworkReply*)), &eventLoop, SLOT(quit())); QUrl link = info.urlString; QNetworkRequest request(link); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); QJsonObject obj; obj["username"] =info.usernameString; QJsonDocument doc(obj); QByteArray data = doc.toJson(); QNetworkReply* reply = mgr.post(request, data); eventLoop.exec(); if (reply->error() == QNetworkReply::NoError) { QString output = reply->readAll(); QJsonObject doc = QJsonDocument::fromJson(output.toUtf8()).object(); delete reply; return true; } else { QString output = reply->readAll(); QJsonObject doc = QJsonDocument::fromJson(output.toUtf8()).object(); delete reply; return false; } }
The error reported is the following line:
onecore\net\netprofiles\service\src\nsp\dll\namespaceserviceprovider.cpp(550)\nlansp_c.dll!(local memory location): (caller: (local memory location)) LogHr(1) tid(76f0) 8007277C No such service is known. The service cannot be found in the specified name space.
The problem is similar to as listed in this stack overflow post , however no solution was listed .
As this function has worked fine up until Monday, I'm hoping someone can help me figure out what's changed about QT or Windows over the weekend that these requests have stopped working, and if I need to start upgrading to a newer version of QT. Thanks in advance!
-
Has use of HTTP REST API requests been deprecated over the last weekend? We have been making requests to our servers just fine prior. Starting this week no response comes from requests made using QT's QNetworkAccessManager. The HTTP requests no longer work on any current or previous version/build of our project.
I am working with QT 5.15.15 in Visual Studio on Windows 11.
Below is an example of how our server is communicated with.
bool readData(customStruct &info) { QEventLoop eventLoop; QObject::connect(&mgr, SIGNAL(finished(QNetworkReply*)), &eventLoop, SLOT(quit())); QUrl link = info.urlString; QNetworkRequest request(link); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); QJsonObject obj; obj["username"] =info.usernameString; QJsonDocument doc(obj); QByteArray data = doc.toJson(); QNetworkReply* reply = mgr.post(request, data); eventLoop.exec(); if (reply->error() == QNetworkReply::NoError) { QString output = reply->readAll(); QJsonObject doc = QJsonDocument::fromJson(output.toUtf8()).object(); delete reply; return true; } else { QString output = reply->readAll(); QJsonObject doc = QJsonDocument::fromJson(output.toUtf8()).object(); delete reply; return false; } }
The error reported is the following line:
onecore\net\netprofiles\service\src\nsp\dll\namespaceserviceprovider.cpp(550)\nlansp_c.dll!(local memory location): (caller: (local memory location)) LogHr(1) tid(76f0) 8007277C No such service is known. The service cannot be found in the specified name space.
The problem is similar to as listed in this stack overflow post , however no solution was listed .
As this function has worked fine up until Monday, I'm hoping someone can help me figure out what's changed about QT or Windows over the weekend that these requests have stopped working, and if I need to start upgrading to a newer version of QT. Thanks in advance!
Since 5.15.15 is a commercial release you should ask the Qt support for help.
You can also search the bugtracker for similar issues but I did not find something except https://bugreports.qt.io/browse/QTBUG-110468?jql=text ~ "namespaceserviceprovider" -
Hi and welcome to devnet,
Beside the good suggestion of @Christian-Ehrlicher and
based on the answer of the linked thread, did you had an update done to your Windows machine ?Did you try to run your application on a different Windows version ?