PDA

View Full Version : Document/literal Soap Message..



rmagro
2nd July 2009, 17:47
Hi all,
I have been using without any problem the RPC/encoding Soap message with Qt..

Here, a code snippet to show you how I use it to send request to a web service:



//I first create my xml request as follows (is an example..)
QDomDocument doc("");
QDomElement root = doc.createElement("request_root");
doc.appendChild(root);

QDomElement tag = doc.createElement("first_child");
root.appendChild(tag);
QDomText t = doc.createTextNode("first_value");
tag.appendChild(t);

QDomElement tag1 = doc.createElement("second_child");
root.appendChild(tag1);
QDomText t1 = doc.createTextNode(second_value);
tag1.appendChild(t1);

// I then get the QString...
QString xmlRequest = doc.toString();


//I build the soap message as follows:
QtSoapMessage request;
request.setMethod("method_name", "https://service_url");
request.addMethodArgument("message_tag", "", xmlRequest );

//
QString requestMessage = request.toXmlString();

//and so on posting this to the web service URL..



The question is..is there an equivalent way of doing that for Document/Literal SOAP messages???

THX

wysota
2nd July 2009, 18:05
QtSoap module only supports one encoding.