I'm currently working on updating the web client integration plugin to version 5.1. All interfaces has changed. For now I'm able to start the plugin and initialize everything using startup() method. But when I call connect(), nothing happens. No error, no messages, nothing! How do I debug this?
Here's the code:
<object
name="VmWareRdpClient"
id="VmWareRdpClient"
classid="CLSID:4AEA1010-0A0C-405E-9B74-767FC8A998CB"
codebase="https://dcmrrvc041.corp.microsoft.com/vsphere-client/vmrc/VMware-ClientIntegrationPlugin-5.1.0.exe"
standby="Please wait while the console loads..."
width="100%"
height="100%">
<param name="_cx" value="27120" />
<param name="_cy" value="20346" />
<param name="fullScreen" value="0" />
</object>
<script language="javascript1.2" type="text/javascript">
var consoleClient;
consoleClient = document.getElementById("VmWareRdpClient");
var serverName = "dcmrrvc041.corp.microsoft.com";
var rdpPort = 443;
var serverNameWithPort = "dcmrrvc041.corp.microsoft.com:443";
var vmInstanceId = "vm-144";
var authTicket = "cst-VCT-529f6950-5c8a-02d2-7b54-ee56496fa822--tp-88-93-A8-0A-10-BB-81-D1-4F-6A-AC-37-A1-0C-C2-EF-F4-ED-5A-20";
var consoleClientVersion = (typeof(consoleClient.Version) !== "undefined") ? parseFloat(consoleClient.Version) : parseFloat(consoleClient.getVersion());
var MODE_EMBEDDED = 1;
var MODE_WINDOW = 2;
var connectAttempt = 0;
if (consoleClient != null) {
// start trying to connect here
FirstConnection();
}
else {
var consoleDiv = document.getElementById("panelForVmWare");
consoleDiv.innerHTML = "<div>Unable to create the VMware ActiveX control</div>";
}
function DisplayStatus(status) {
var messageBar = document.getElementById("divRemoteConnectionMessageBarVmWare");
messageBar.innerHTML = "<br />" + status;
}
function FirstConnection() {
var status = "Loading";
connectAttempt = (connectAttempt + 1) % 4;
for (var i = 0; i < connectAttempt; i++) {
status += ".";
}
DisplayStatus(status);
if (consoleClientVersion < 2.5) {
// only works with version 2.5 and higher...
if (!IsInstalled(consoleClient)) {
// the activeX has not yet been installed - try again after a short interval.
window.setTimeout("FirstConnection();", 500);
return;
}
}
// once installed, do the connect thing...
try {
if (consoleClientVersion >= 5.1) {
if (!consoleClient.isReadyToStart()) {
window.setTimeout("FirstConnection();", 500);
return;
}
consoleClient.startup(0, 2, "");
consoleClient.connect("dcmrrvc041.dcmanager.lab", "", false, authTicket, "", "", vmInstanceId, "", "");
// everything works till this line. no errors so far. server can be seen from here and can be successfully pinged and i can connect it from stand-alone console.
// auth ticket is new, here's the latest: cst-VCT-529f6950-5c8a-02d2-7b54-ee56496fa822--tp-88-93-A8-0A-10-BB-81-D1-4F-6A-AC-37-A1-0C-C2-EF-F4-ED-5A-20
// vmInstanceId is also refreshed each time, here's the latest one: vm-144
// no feedback at all. nothing happens. how do i debug what is the connection issue here??
} else if (consoleClientVersion >= 2.5) {
// send CAD and fullscreen buttons not available with window'd mode.
var actionBar = document.getElementById("divRemoteConnectionActionBarVmWare");
var sendCadButton = document.getElementById("btnSendCtrlAltDelVW");
actionBar.removeChild(sendCadButton);
var fullscreenButton = document.getElementById("btnFullScreenVW");
actionBar.removeChild(fullscreenButton);
consoleClient.connectWithSession(serverNameWithPort, authTicket, vmInstanceId, MODE_WINDOW);
consoleClient.style.display = "none";
// ticket cannot be used for reconnect, so once the connect succeeds, we remove the reconnect button.
var reconnectButton = document.getElementById("btnReconnectVW");
actionBar.removeChild(reconnectButton);
}
else {
consoleClient.connect(serverName, rdpPort, vmInstanceId, authTicket, authTicket);
}
DisplayStatus("");
}
catch (error) {
DisplayStatus("Cannot connect: " + error.message + "<br /><br />Wait for installation of the ActiveX control to complete, and try again.");
}
}
function IsInstalled() {
var testProperty = null;
try {
testProperty = consoleClient.VMScreenWidth;
}
catch (activeXNotInstalledEx) {
return false;
}
return (testProperty != undefined);
}
function SendCtrlAltDel() {
try {
consoleClient.SendCAD();
}
catch (error) {
DisplayStatus("Unable to send Ctrl+Alt+Del: " + error + "<br /><br />Wait for installation of the ActiveX control to complete, and try again.");
}
}
function Reconnect() {
// just reload the whole page to avoid 'damaged' active X
window.location.reload();
}
function GoFullScreen() {
try {
consoleClient.SetFullScreen(true);
}
catch (error) {
DisplayStatus("Unable to display in full-screen mode: " + error + "<br /><br />Wait for installation of the ActiveX control to complete, and try again.");
}
}
</script>
Thanks in advance for any help!!