Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

New Developer
Posts: 9
Registered: ‎05-20-2009
My Device: Not Specified

SOAPXML sample to get the xml result from the Dataset

[ Edited ]

I'm using the SOAPXML sample and modify some code to use our company own web services. However, I found when retreive the results using the follow code, it will show nothing value in the COST and AMOUNT.


if (QString::compare("true", responseValue["Success"].toString(), Qt::CaseInsensitive) == 0) {
        m_succeeded = true;

        m_temperature = responseValue["COST"].toString();
        m_description = responseValue["AMOUNT"].toString();
        emit temperatureChanged();
        emit descriptionChanged();
     else {
       m_succeeded = false;
        m_error = responseValue["ResponseText"].toString();


I compare the XML output file from weatherService and our own services. It seem the output format is different.



  <?xml version="1.0" encoding="utf-8" ?>
  <ResponseText>City Found</ResponseText>
  <Visibility />
  <WindChill />
  <Remarks />
My Own Services:
  <?xml version="1.0" encoding="utf-8" ?>
- <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xs:element name="NewDataSet" msdata&colon;IsDataSet="true" msdata&colon;UseCurrentLocale="true">
- <xs:complexType>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element name="Table1">
- <xs:complexType>
- <xs:sequence>
  <xs:element name="SHOPID" type="xs:string" minOccurs="0" />
  <xs:element name="SHOPNAME" type="xs:string" minOccurs="0" />
  <xs:element name="QTY" type="xs:decimal" minOccurs="0" />
  <xs:element name="COST" type="xs:string" minOccurs="0" />
  <xs:element name="AMOUNT" type="xs:string" minOccurs="0" />
- <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
- <NewDataSet xmlns="">
- <Table1 diffgr:id="Table11" msdata&colon;rowOrder="0" diffgr:hasChanges="inserted">
I noticed mine one like as a table using the <DataSet> and have rowOrder (Sometimes I need get multiple records), How can I get those value (multiple records) which is insided in the DataSet?


Posts: 16,583
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: SOAPXML sample to get the xml result from the Dataset

i use QtSoap, so i can only answer for that.
you can work with QtSoapStruct and QtSoapArray to parse complex responses.


QtSoapStruct &soapStruct = (QtSoapStruct &) resp.method();
QtSoapArray &attributes = (QtSoapArray &) soapStruct["Attributes"];
for (int i = 0; i < attributes.count(); ++i) {
	QtSoapStruct &item = (QtSoapStruct &) attributes[i];
QString attributeName = item["Attributename"].toString().toLower(); //... }


feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter