newb_developer
22nd June 2012, 18:35
Hello,
I have the following Qt SOAP getresponse code:
void MainWindow::getResponse()
{
/*
* Get a reference to a response message.
*/
const QtSoapMessage &message = http.getResponse();
/*
* Check if the message is a SOAP Fault message.
*/
if(message.isFault()) {
QMessageBox::critical(this, "Error", message.faultString().toString());
return;
} else {
// print the return value
const QtSoapType &response = message.returnValue();
ui->textEdit->setText(response["GetWhoISResult"].value().toString().toLatin1().constData());
}
}
I get the following response XML message: I'd like to convert it's GetWhoISResult to QString, then display it in QTextBox.
ui->textEdit->setText(message.toXmlString());
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<GetWhoISResponse xmlns="http://www.webservicex.net">
<GetWhoISResult xmlns="http://www.webservicex.net" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">previous request is being processed for 173.201.44.188</GetWhoISResult>
</GetWhoISResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
This code fails:
ui->textEdit->setText(response["GetWhoISResult"].value().toString().toLatin1().constData());
I get nothing.
How can I try to solve this?
I have the following Qt SOAP getresponse code:
void MainWindow::getResponse()
{
/*
* Get a reference to a response message.
*/
const QtSoapMessage &message = http.getResponse();
/*
* Check if the message is a SOAP Fault message.
*/
if(message.isFault()) {
QMessageBox::critical(this, "Error", message.faultString().toString());
return;
} else {
// print the return value
const QtSoapType &response = message.returnValue();
ui->textEdit->setText(response["GetWhoISResult"].value().toString().toLatin1().constData());
}
}
I get the following response XML message: I'd like to convert it's GetWhoISResult to QString, then display it in QTextBox.
ui->textEdit->setText(message.toXmlString());
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<GetWhoISResponse xmlns="http://www.webservicex.net">
<GetWhoISResult xmlns="http://www.webservicex.net" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">previous request is being processed for 173.201.44.188</GetWhoISResult>
</GetWhoISResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
This code fails:
ui->textEdit->setText(response["GetWhoISResult"].value().toString().toLatin1().constData());
I get nothing.
How can I try to solve this?