function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
bdr_09bdr_09 

How to generate XML file with QueryResult ?

Hi

 

       Is there any way to generate XML file with the QueryResult object?

       

Thanks,

--bdr

Message Edited by bdr_09 on 01-27-2010 02:11 AM
LosintikfosLosintikfos

When you create a Query to invoke on sforce, the query automatically is an XML document. Meaning when result is returned in a form of ResponseDocument, you automatically have an XML document.

 

for example:

 

//-->This is an XML doument

QueryResponseDocument queryResponseDocument = $scon.stub.query( queryDocument, $scon.sessionHeaderDocument, null, null, null);

 

//-->Therefore you can print to view the content or Pipe it to a file

System.out.println(queryResponseDocument);

 

//-->The actual response it also an XML file therefore you can system print to view its output

//-->or pipe it to a file on your local/remote disc

QueryResponse queryResponse = queryResponseDocument.getQueryResponse();

System.out.println(queryResoonse);

 

//--> Print the actual query result

QueryResult queryResult = queryResponse.getResult();

System.out.println(queryResult);