Results 1 to 7 of 7

Thread: How to cccess XML api correctly?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to cccess XML api correctly?

    Use a network sniffer like ethereal to find out what data is sent over network, really.
    (It helps to be sure that you actually send and receive correctly formatted xml and the reply matches your expectations.)

    HTH

  2. #2
    Join Date
    Apr 2009
    Posts
    5
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to cccess XML api correctly?

    Thanks for the pointer. I just tried doing that wireshark and fail miserable primarily because I donot know what I should be looking for. Wireshark spitted out loads of information. What do I look for and where? Any pointers?

    I am still wondering if my way of passing xml over the network is wrong? Should I be doing it some other way?

  3. #3
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to cccess XML api correctly?

    try maybe to print the reply data with qDebug() or to some QTextBrowser or something to see how it looks like.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  4. #4
    Join Date
    Apr 2009
    Posts
    5
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to cccess XML api correctly?

    That is exactly what readXml() does. It takes the QNetworkReply and creates a QXmlStreamReader out of it and then parses it. The xml looks like this -
    Qt Code:
    1. <response status="fail">
    2. <error>Incorrectly formatted xml</error>
    3. </response>
    To copy to clipboard, switch view to plain text mode 

  5. #5
    Join Date
    Apr 2009
    Posts
    5
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to cccess XML api correctly?

    For the sake of completeness, if I post the same xml using curl commandline, it works great and gives me the correct response as well.

Similar Threads

  1. Howto benchmark QT correctly?
    By Linuxhippy in forum Qt Programming
    Replies: 1
    Last Post: 8th October 2008, 08:01
  2. renderText is not working correctly
    By validator in forum Qt Programming
    Replies: 3
    Last Post: 27th May 2008, 16:55
  3. correctly installed Qt4
    By Salazaar in forum Installation and Deployment
    Replies: 31
    Last Post: 7th May 2007, 07:24
  4. Replies: 1
    Last Post: 23rd August 2006, 18:02
  5. Replies: 6
    Last Post: 20th April 2006, 10:23

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.