Results 1 to 4 of 4

Thread: Problem with QHttp

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Problem with QHttp

    Hi,

    I want to send an XML Schema File to a MULTI-PART server running web-service and the server automatically replies back with an XML File.

    I have constructed the Http Header as follows.

    Qt Code:
    1. QFile infile;
    2. infile.setFileName("Path\\GetInfoSchema.xsd");
    3. if (!infile.open(QIODevice::ReadOnly))
    4. {
    5. return;
    6. }
    7. QByteArray inputStr(infile.readAll());
    8.  
    9. outfile.setFileName("Path\\webSrvResult.xml");
    10. outfile.open(QIODevice::WriteOnly | QIODevice::Truncate);
    11.  
    12. QUrl url("webserver/PelletTestWebServiceWeb/");
    13. http->setHost(url.host(), url.port(80));
    14.  
    15. QHttpRequestHeader header("POST", "http://xyzserver:8080/PelletTestWebServiceWeb/XmlQueryInterface");
    16. header.setValue("multipart/mixed", "application/x-www-form-urlencoded");
    17. http->request(header,inputStr, &outfile);
    To copy to clipboard, switch view to plain text mode 

    But the problem is that I am unable to get back the XML document from the server using this. I am being told that this is due to the fact that the server is Multipart.

    But I am unable to solve this.

    Can anyone please help?

    Thanks!
    Last edited by wysota; 19th March 2009 at 13:34. Reason: missing [code] tags

Similar Threads

  1. QHttp proxy problem
    By andre.rigon in forum Qt Programming
    Replies: 2
    Last Post: 28th September 2008, 21:19
  2. problem in using QHttp
    By Ferdous in forum Newbie
    Replies: 4
    Last Post: 10th September 2008, 12:07
  3. Problem in using QHttp with QTimer
    By Ferdous in forum Newbie
    Replies: 2
    Last Post: 6th September 2008, 12:48
  4. QHttp download file problem.
    By fengtian.we in forum Qt Programming
    Replies: 12
    Last Post: 12th June 2007, 09:39
  5. QHttp Problem
    By musaulker in forum Newbie
    Replies: 4
    Last Post: 29th March 2007, 00:40

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
  •  
Qt is a trademark of The Qt Company.