function create_subscriber(topic_name)
{
body = ""+
"" + domain_id + "" +
""+ topic_name + "" +
"" + type_name + "" +
"" + type_schema + "" +
"" + qos_profile + "" +
"" + "" +
"1" +
"";
subscriber_id[topic_name] = -1;
var url = "/wsdds/" + dds_sessionid + "/subscription";
var xmlhttp = newAjax();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
var xmlResponse = xmlhttp.responseXML;
if(xmlResponse.getElementsByTagName("returnCode")[0].childNodes[0].nodeValue !="0"){
alert(xmlResponse.getElementsByTagName("returnString")[0].childNodes[0].nodeValue+". Please, login again.");
}
else{
subscriber_id[topic_name] = xmlResponse.getElementsByTagName("subscriptionId")[0].childNodes[0].nodeValue;
read(topic_name);
}
}
};
xmlhttp.open('PUT', url, true);
xmlhttp.setRequestHeader("Content-type", "text/xml");
xmlhttp.send(body);
};
function read(topic_name)
{
if(subscriber_id[topic_name] == -1) {
return;
}
url = "/wsdds/" + dds_sessionid +
"/subscription/" +
subscriber_id[topic_name] + "/15/";
var xmlhttp = newAjax();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
var xmlResponse = xmlhttp.responseXML;
var samples = xmlResponse.getElementsByTagName("sample");
for(i=0; i