×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Feb 2004
    Posts
    76

    issue with QWebView handling redirects

    Hi

    I am developing in QT 4.6/4.7 targeting Nokia N8 devices.

    I have written a news reader application that displays a list of news, music, apps and games, and allows the user to launch into a QWebview to purchase content that can then be downloaded to the device

    Now the server side handles matching up the user to their billing account, but what that means is there are a lot of redirects involved from the initial http request.

    Now if I launch to the native browser from the application, then the server side billing object is created and I can view and purchase content.

    However this same url doesn’t work if I launch it from a QWebview, in fact all I get back is an empty HTML document.
    Now the form of the request is something like this (I can't publish actual url’s sorry)

    http://www.musicsite.com/getItem.do?id=9999

    I can also do it like this

    http://www.create-me-a-sessionid.com...em.do?iid=9999

    Which should create a billing session and then pass that to www.musicsite.com.

    If I manually type the second url into the default web browser then it will create the session id and download the shop web page.

    I have created a specialised implementation of the QWebpage, where by I override the user agent, and I am also adding additional header information to the url prior to sending it.

    But I am really struggling to get the QWebpage to display this data

    As anyone attempted anything similar?
    Can anyone offer any advice or assistance?

    Thanks in advance

    Guus Davidson

    PS sorry for the vague post

  2. #2
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: issue with QWebView handling redirects

    Hi,
    Hard to say what is the problem, but you could:
    1. Sniff http stream (if it's not https) using wireshark, so you can understand which data goes and comes. You can compare the streams sent by your app and by a standard browser.
    2. Are cookies enabled?
    3. Does your app work using a plain QWebView?
    4. Have you tried to check if it works with Arora browser? (it's written completely in Qt!)

    I hope my advice can help you a little bit.

  3. #3
    Registered User
    Join Date
    Feb 2004
    Posts
    76

    Re: issue with QWebView handling redirects

    Hi gnutton,

    Thanks for your suggestions, they are much appreciated,
    I hadn't thought of enabling cookies , nor had I heard of the arora browser.

    I will try it out
    regards

    Guus

  4. #4
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: issue with QWebView handling redirects

    Seems to me that you've got one too many "?" character in that second URL.

  5. #5
    Registered User
    Join Date
    Feb 2004
    Posts
    76

    Re: issue with QWebView handling redirects

    yeah sorry thats just a typo in my question,

    Guus Davidson

  6. #6
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: issue with QWebView handling redirects

    If cookies support is turned off of course it won't work.
    Let us know how it goes. A network sniffer can even show cookies you get.

  7. #7
    Registered User
    Join Date
    Feb 2004
    Posts
    76

    Re: issue with QWebView handling redirects

    I had a quick look through the help on the QNetworkAccessManager class , and as far as the documentation goes I shouldn't have to enable the cookies or write my own cookie jar

    http://doc.qt.nokia.com/latest/qnetw...l#setCookieJar

    "QNetworkAccessManager by default does not implement any cookie policy of its own: it accepts all cookies sent by the server, as long as they are well formed and meet the minimum security requirements (cookie domain matches the request's and cookie path matches the request's)"


    regards

    Guus

Similar Threads

  1. Issue with GUI command handling
    By vinp in forum Symbian User Interface
    Replies: 1
    Last Post: 2010-11-11, 09:27
  2. database handling issue with RPointerArray
    By sunitha.m13 in forum Symbian
    Replies: 3
    Last Post: 2010-03-23, 12:22
  3. Issue in handling Re-Invite Request
    By raj_rr7 in forum Symbian Networking & Messaging (Closed)
    Replies: 8
    Last Post: 2007-10-30, 10:28
  4. Issue regarding mailbox handling
    By dingdongvan in forum Symbian
    Replies: 0
    Last Post: 1970-01-01, 02:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×