Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ with your query.

webservices testing using REST API

Hi below is the snippet from sahi pro 5.x
var $request = new RESTRequest();
$request.addToQueryString("IPAddress", "");
var $response = $request.submit("get");
var $responseBody = $response.getBodyAsString();

// The response is in the form of an xml, so we will parse the xml.
// Alternatively, this can be JSON in which case, we would need to eval the JSON to get the output object attributes.
$data = $responseBody.replace(/<\?xml[^>]*\?>/, "").replace(/(\r\n|\n|\r)/gm,"");
default xml namespace = "";
var $x = new XML($data);
var $CountryCode= $x..CountryCode[0].toString();

i assume this would work in sahi 7.5 ?
i see that while invoking the webservices we need to pass the IP address ? is that the server IP where the webservices is running


Sign In or Register to comment.