Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
New Contributor
Posts: 4
Registered: ‎07-26-2013
My Device: Z10
My Carrier: Airtel

Network manager not returning finish

Hello,

 

My application requires to communicate with a web service. It has to hit at the web service, take the response and fill a container. To access the web service, I am using QNetworkAccessManager. Below is the code snippet:

     

   m_AccessManager = new QNetworkAccessManager(this);
   if(m_Timestamp.isEmpty())
   {
            queryUri = "http://someurl";
            QNetworkRequest request;

            request.setUrl(QUrl(queryUri));
            m_Reply = m_AccessManager->get(request);
            connect(m_Reply, SIGNAL(finished()), this, SLOT(onServiceResponseInitial()));
    }
It works like a charm on the Simulator, but it doesn't on the device. QNetworkRequest never signals "finished".

Since I have to use my company's web service, the application is started on "Work" workspace.

Does anyone has any clue what I am missing here? Do I need to configure my device?

Can someone help me here!

Developer
Posts: 426
Registered: ‎04-10-2011
My Device: Z30

Re: Network manager not returning finish

[ Edited ]

Try using the QNetworkAccessManager's finish signal. You can find an example here.

-----------------------------------------------------------------------------
Check out my apps in the BlackBerry World
Visit my developer blog alopix.net
BBM Channel: C0047B612
Developer
Posts: 96
Registered: ‎06-05-2012
My Device: Developer
My Carrier: Developer

Re: Network manager not returning finish

[ Edited ]

Hi,

Try below code for connect finish signal:
connect(m_AccessManager, SIGNAL(finished(QNetworkReply *)), this, SLOT(onServiceResponseInitial(QNetworkReply*)));

Thanks!
Anand

New Contributor
Posts: 4
Registered: ‎07-26-2013
My Device: Z10
My Carrier: Airtel

Re: Network manager not returning finish

Hello Anand,

 

Thanks for the reply!

Made the changes as suggested but it didn't work Smiley Sad

 

Any more suggestions?

New Contributor
Posts: 4
Registered: ‎07-26-2013
My Device: Z10
My Carrier: Airtel

Re: Network manager not returning finish

It doesn't have "finish" signal.

By the way I am using "finished" signal.
Retired
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: Network manager not returning finish

I'd recommend connecting to QNetworkReply's other signals as well to see if you are getting any data at all, or an error (which you should probably be listening for anyway).

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker
Developer
Posts: 96
Registered: ‎06-05-2012
My Device: Developer
My Carrier: Developer

Re: Network manager not returning finish

[ Edited ]

Hi,

 

Please cross check you .hpp file, did you declare slots or not?

Oherwise please post your complete code.

 

Thanks!