function InvokeWCFService(StageId, RUN_ID)
{ 
   SendProgressReport(StageId,RUN_ID,10783);
}
function SendProgressReport(StageId,RUN_ID,APP_ID)
{
    function icaCheck() 
    {  
        try
        {
	    var icaobj = new ActiveXObject("Citrix.ICAClient.2.4");
	    var ICAVersion;

            if(icaobj != null)
            {                    
               ICAVersion = "2.4"
            }            
            else
            {          
               ICAVersion = "0";
            } 
            return ICAVersion;
         } 
         catch(e)
         {
	    return "0"; 
         }
    }
    
    try 
    {              
        var ICAVersion="0";
	// ICAVersion is only saved in DB when StageId == 1 right now...
	// not neccessary to call function for other stages
        //if((StageId == 5) || (StageId == 1)) { // 5 is used in appletscript
        //        ICAVersion=icaCheck();
        //}

        var data = '';
		data += '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">';
		data += '<s:Body>';
		data += '<InsertConfigurationDetails xmlns="Runaware">';
		data += '<StageId>' + StageId + ' </StageId>';
		data += '<RUN_ID>' + RUN_ID + ' </RUN_ID>';
		data += '<APP_ID>' + APP_ID + ' </APP_ID>';
		data += '<ScreenWidth>' + screen.width + ' </ScreenWidth>';
		data += '<ScreenHeight>' + screen.height + ' </ScreenHeight>';
		data += '<ColourDepth>' + screen.colorDepth + ' </ColourDepth>';
		data += '<ICAVersion>' + ICAVersion + ' </ICAVersion>';
		data += '</InsertConfigurationDetails>';
		data += '</s:Body>';
		data += '</s:Envelope>';       
      
        function createXMLHTTPObject() 
        {
            var xmlHttp = false;
            var XMLHttpFactories = 
            [
	            function () {return new XMLHttpRequest()},
	            function () {return new ActiveXObject("Msxml2.XMLHTTP")},
	            function () {return new ActiveXObject("Msxml3.XMLHTTP")},
	            function () {return new ActiveXObject("Microsoft.XMLHTTP")},
	            function () {return new ActivexObject("Msxml2.XMLHTTP.4.0")}	            
             ];


                  for (var i=0;i<XMLHttpFactories.length;i++) 
                  {
                      try 
                      {
                         xmlHttp = XMLHttpFactories[i]();
                       }
                      catch (e) 
                      {
                        continue;
                        }
                        break;
                    }
            return xmlHttp;
           }        
       
	        var vdirname='/DemoConnectService'
            var xmlHttp = false;            
            xmlHttp = createXMLHTTPObject();
            xmlHttp.open('POST',vdirname + '/ConnectionWizardService.svc', true);
            //xmlHttp.open('POST','ConnectionWizardService.svc', true);
            xmlHttp.onreadystatechange = function ( ) 
            {
              if(xmlHttp.readyState == 4) 
               {                            
                }
             };               
                    
 	        xmlHttp.setRequestHeader('SOAPAction', 'Runaware/IConnectionWizardService/InsertConfigurationDetails');	 	
 	        xmlHttp.setRequestHeader('Content-Type', 'text/xml');
            xmlHttp.send(data);
        }
        catch(e)
        {            
        }
          
}