+ Start a Discussion
soasoa 

Cannot find XMLDOM

Hi.

I am trying to invoke a REST  web service through Force.com as mentioned in the example provided in

http://wiki.apexdevnet.com/index.php/Force.com_Zillow_Mashup

I had used the following code for  parsing the XML document ( please see the code below )

Code:
public class PropertySearchResponse {   
xmldom.element searchResult ;
 public Double getZEstimateAmount(){
        Double.valueOf( searchResult.getElementByTagName( 'amount').nodeValue ) ;
     return d ; 
  } 
}

While compiling the code I am getting the following error

ErrorError: Compile Error: Invalid type: xmldom.element at line 2 column 1

Would you please guide me how to use XMLDOM ? I think it is not able to recognise XMLDOM. However I tried the XMLReader document and it run fine.

Alternatively is there any way to convert the Httpresponse sent by the REST Service into an XMLReader, which we can parse thereafter.

regards,

Diti

werewolfwerewolf
Download the zip file at the bottom of that example.  The XMLDom class is included in it.  XMLDom is not a built-in class.
soasoa

Hi,

Thanks for the immediate reply. It solved my problem.

For the Zillow example.. instead of building a UI, I tried to invoke it on a button click.

the code for the button is :

Code:
{!REQUIRESCRIPT("/soap/ajax/10.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/10.0/apex.js")} 

//var accounts = prompt("Please enter the accounts value"); 

var result = sforce.apex.execute 
( 
"ZillowService", // class 
"searchZillow", 
// method 
{ //method arguments 
} 
); 


alert (response);


 On clicking this button , I am getting the Following error..
 

A problem with OnClick javascript for this button or link was encountered:

{faultcode:'soapenv:Client',faultstring:'No operation available for request{http://soap.sforce.com/schemas/package/ZillowService}searchZillow, please check theWSDL for the service.',}

please help...
 
regards
Diti