Getting Invalid RPC error when using QNetworkAccessManager How to fix it?
-
Here is my code: It's getting an error at line 7 of:
As a popup window error shows:
Exception Triggered
The inferior stopped because it triggered an exception.Stopped in thread 0 by: Exception at 0x7fefcdc9e5d, code: 0x6a6: Invalid RPC server, flags=0x1 (execution cannot be continued) (first chance).
In issues window error shows:
Exception at 0x7fefcdc9e5d, code: 0x6a6: Invalid RPC server, flags=0x1 (execution cannot be continued) (first chance)How to I fix this? (Hopefully someone has encountered this before)
@1 if (request->httpMethod() == KQOAuthRequest::POST)
2 {
3 networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, request->contentType());
4
5 if (request->contentType() == "application/x-www-form-urlencoded")
6 {
7 reply = d->networkManager->post(networkRequest, request->requestBody());
8 }
9 }@Edit: please, no shouting in the title (or elsewhere); Andre
-
Does anybody here know anything about QNetworkRequests?
Does anybody have any clue what the above exception indicates and what the solution could be??I'm stumped.
-
bump
I ran into a similar problem. Is there anyone who might know the reason?
-
Hey OldDeath,
Although, I'm not happy that you also have the same problem, I am happy that someone else has joined this issue.
I needed this to work in Qt and couldn't solve it quickly enough to meet deadlines, so I switched to Java to get OAuth 1.0a working.
If you find a way to get this working, I would greatly appreciate you sharing it with me.
with empathy,
codewriter -
Platform? Qt version? Compiler toolchain? Network environment?
Classes and libraries involved? We could guess KDE classes from the "K" but it seems we'd be wrong.
What have you done to debug this?
Content of the request?
Minimal complete example that reproduces the problem?Is d->networkManager a valid pointer?
d->networkAccessManager is a KQOAuthManager not a QNetworkAccessManager right?
Have you asked the kQOAuth author/mailing list/forum? -
Platform:
Win7 x64 using MSVC12 as a toolchain.As for what I've done to debug it? Nothing so far. After reading this post I've tried commenting out the part of my code that was using the QNetworkAccessManager and the first chance exception (which didn't trigger a popup in my case, BTW but only a message line in the issues panel) was gone. As I have been busy with debugging something else ever since I have not come around looking deeper in the issue until now...
-
Dear ChrisW67,
The plarform in Win 7 Ultimate 64bit Service pack 1, 8 gig of ram.
Qt version = Qt Creator 2.7.2 based on Qt 5.1.0 (32 bit)
Built on Jul 2 2013 at 20:48:03
From revision ea5aa79dca
Kit use = Desktop Qt 2.1.0 MSVC2012 QopenGL 64 bit (default)Network environment = TimeWarner Cable Internet local modem and router
There is 1 library involved, the kqoauth library found at: http://www.johanpaul.com/blog/2010/10/introducing-kqoauth-easy-and-powerful-oauth-library-for-qt/
This whole thing started when I tried to do an OAuth 1.0a implementation in C++ using Qt to connect with streaming quotes generated by the TradeKing stock broker.
The kqoauth library was supposed to make it easy to since it is Qt-based.
The error message described above happens inside the library in file kqoauthmanager.cpp in the
void KQOAuthManager::executeAuthorizedRequest functionUnfortunately, I can't give a minimal "complete" example because I can't reveal the secret tokens.
I'm basically trying to post a request to TradeKing by providing
CONSUMER_KEY =
CONSUMER_SECRET =
ACCESS_TOKEN =
ACCESS_TOKEN_SECRET =
API_URL =
"https://stream.tradeking.com/v1/market/quotes.xml?symbols=TSLA";
HTTP_METHOD = "POST"; //or GET
SIGNATURE_METHOD = "HMAC-SHA1";
OAUTH_VERSION = "1.0a";
NONCE = "???";
OAUTH_SIGNATURE = "???";
TIMESTAMP = "???";I can fully understand how complicated it is to help figure out the problem in this circumstance.
I contacted the author but he wasn't able to resolve the issue.
It's clear the library uses the QNetworkAccessManager. This is why I believed it would be simpler to approach the problem from a purely QNetworkAccessManager point of view while disregarding the library and perhaps even foregoing the use of the library altogether.
Maybe it's better just to ask help on how to use the QNetworkAccessManager to connect to TradeKing streaming as defined above.
I got everything to work quickly in Java long ago when I had this problem, but at this distant date I'm curious about how to do this in Qt even though there are other non-Qt centric C++ libraries that can successfuly do OAuth 1.0a more easily than in Qt.