private void extractDetails(AsyncResult result) {
Iterator iterator0, iterator1, iterator2, iterator3, iterator4;
SOAPEnvelope resEnvilop;
OMElement body;
OMElement operation;
OMNode node;
OMElement elem;
resEnvilop = result.getResponseEnvelope();
body = resEnvilop.getBody();
operation = body.getFirstElement();
String opLocalName = operation.getLocalName();
if (opLocalName.equals("Fault")) {
log.info(
"A Fault message received, Check your Licence key");
strURL =
strURL +
"A Fault message received, Check your Licence key. Else you have reached the " +
"daily limit of 1000 requests";
} else {
log.info("this is opera: " + operation.getLocalName());
iterator0 = operation.getChildren();
while (iterator0.hasNext()) {
node = (OMNode) iterator0.next();
if (node.getType() == OMNode.ELEMENT_NODE) {
elem = (OMElement) node;
String str = elem.getLocalName();
log.info(str);
if (str.equals("SearchResult")) {
log.info("Got Search Results");
iterator1 = elem.getChildren();
while (iterator1.hasNext()) {
node = (OMNode) iterator1.next();
if (node.getType() == OMNode.ELEMENT_NODE) {
elem = (OMElement) node;
String str1 = elem.getLocalName();
log.info(str1);
if (str1.equals("Alexa")) {
log.info("Got Alexa");
elem = elem.getFirstElement(); //elem -> websearch
log.info("Should be WebSearch " +
elem.getLocalName());
iterator2 = elem.getChildren();
while (iterator2.hasNext()) {
node = (OMNode) iterator2.next();
if (node.getType() ==
OMNode.ELEMENT_NODE) {
elem = (OMElement) node;
String str3 = elem.getLocalName();
if (str3.equals("Results")) {
iterator3 = elem.getChildren();
while (iterator3.hasNext()) {
node =
(OMNode) iterator3.next();
if (node.getType() ==
OMNode.ELEMENT_NODE) {
elem =
(OMElement) node;
String str4 = elem.getLocalName();
if (str4.equals(
"Result")) {
iterator4 =
elem.getChildren();
while (iterator4.hasNext()) {
node =
(OMNode) iterator4.next();
if (node.getType() ==
OMNode.ELEMENT_NODE) {
elem =
(OMElement) node;
String str5 = elem.getLocalName();
if (str5.equals(