mridulgandhi
19th March 2009, 13:23
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.
QFile infile;
infile.setFileName("Path\\GetInfoSchema.xsd");
if (!infile.open(QIODevice::ReadOnly))
{
return;
}
QByteArray inputStr(infile.readAll());
outfile.setFileName("Path\\webSrvResult.xml");
outfile.open(QIODevice::WriteOnly | QIODevice::Truncate);
QUrl url("webserver/PelletTestWebServiceWeb/");
http->setHost(url.host(), url.port(80));
QHttpRequestHeader header("POST", "http://xyzserver:8080/PelletTestWebServiceWeb/XmlQueryInterface");
header.setValue("multipart/mixed", "application/x-www-form-urlencoded");
http->request(header,inputStr, &outfile);
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!
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.
QFile infile;
infile.setFileName("Path\\GetInfoSchema.xsd");
if (!infile.open(QIODevice::ReadOnly))
{
return;
}
QByteArray inputStr(infile.readAll());
outfile.setFileName("Path\\webSrvResult.xml");
outfile.open(QIODevice::WriteOnly | QIODevice::Truncate);
QUrl url("webserver/PelletTestWebServiceWeb/");
http->setHost(url.host(), url.port(80));
QHttpRequestHeader header("POST", "http://xyzserver:8080/PelletTestWebServiceWeb/XmlQueryInterface");
header.setValue("multipart/mixed", "application/x-www-form-urlencoded");
http->request(header,inputStr, &outfile);
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!