*
* @param result
*/
private void extractDetails(AsyncResult result) {
Iterator iterator,iterator2;
OMNode node;
SOAPBody body;
OMElement operation, elem;
SOAPEnvelope resEnvelope;
// /////////////////////////////////////////
// try {
// XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(
// System.out);
// result.getResponseEnvelope().serializeWithCache(writer);
// //part.serialize(writer,false);
// writer.flush();
//
// } catch (XMLStreamException e) {
// // System.out.println("Error occured after responce is received");
// e.printStackTrace();
// } catch (FactoryConfigurationError e) {
// //System.out.println("Error occured after responce is received");
// e.printStackTrace();
// }
// ////////////////////////////////////////////////
resEnvelope = result.getResponseEnvelope();
body = resEnvelope.getBody();
operation = body.getFirstElement();
if (body.hasFault()){
snippet =
snippet +
"A Fault message recieved, Check your Licence key. Else you have reached the" +
" daily limit of 1000 requests";
} else {
OMElement part = operation.getFirstElement();
iterator = part.getChildren();
while (iterator.hasNext()) {
node = (OMNode) iterator.next();
if (node.getType() == OMNode.ELEMENT_NODE) {
elem = (OMElement) node;
String str = elem.getLocalName();
//System.out.println(str);
if (str.equals("resultElements")) {
//System.out.println("Got the Result Elements");
Iterator iterator0 = elem.getChildren();
while (iterator0.hasNext()) {
node = (OMNode) iterator0.next();
if (node.getType() == OMNode.ELEMENT_NODE) {
elem = (OMElement) node;
if (elem.getLocalName().equals("item")) {
iterator2 = elem.getChildren();
while (iterator2.hasNext()) {
node = (OMNode) iterator2.next();
if (node.getType() == OMNode.ELEMENT_NODE) {
elem = (OMElement) node;
String str3 = elem.getLocalName();
System.out.println(str3);
if (elem.getLocalName().equals("snippet")) {
//System.out.println("Got the snippet");