Welcome!

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

Reply
Developer
Posts: 84
Registered: ‎04-22-2013
My Device: BB 10 Dev
My Carrier: Simulator

How to parse XML String from soap response

Hi all,

I'm getting a response back from server in xml format.

I've tried the way from soapxml sample but is not working on me.

So how do i parse this xml string?

any guides  or example are welcome.

 

what i have now is like this

const QtSoapMessage& response = m_soap.getResponse();
const QtSoapType& responseValue = response.returnValue();

response.returnValue is giving me an empty string but response.toXmlString(0) does give me complete xml string.

 

<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:Header xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <security xmlns="http://security.jess.com/">
      <csrf_token xmlns="http://security.jess.com/" xmlns="" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">069207</csrf_token>
    </security>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <performLoginResponse xmlns="http://adapter.jess.com/">
      <return>
        <obHeader>
          <statusCode xmlns="" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">0000000</statusCode>
        </obHeader>
        <obUser>
          <cifNumber xmlns="" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">36148472</cifNumber>
          <fullName xmlns="" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">Jordan</fullName>
        </obUser>
        <userContext>
          <loginId xmlns="" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">mycust019</loginId>
          <sessionId xmlns="" xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"></sessionId>
        </userContext>
      </return>
    </performLoginResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

 

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: How to parse XML String from soap response

I have no experience with soap on BB10 however there are a number of classes that handle XML...

 

http://developer.blackberry.com/native/reference/cascades/qxmlstreamreader.html

 

http://developer.blackberry.com/native/reference/cascades/bb__data__xmldataaccess.html

 

http://developer.blackberry.com/native/reference/cascades/qtxml.html?f=qtxml

 

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.