VMware

This Question is Possibly Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (6 pts)
1 Replies Last post: Oct 28, 2009 10:33 AM by lemke  

Error code 3 return from VixHost_Connect() posted: Oct 28, 2009 9:06 AM

Click to view mic21's profile Novice 10 posts since
Oct 26, 2009

hi guys,
I'm using VIX 1.6.2 and VIServer-2.0.0. I wrote a C program to connect to VI SERVER and I can not continue because I get an error
after the VixHost_Connect () function. The Code is:


code-----------------------------------------------------

#include "vix.h"
#include<stdio.h>
#include<conio.h>

#define VMPOWEROPTIONS VIX_VMPOWEROP_NORMAL

int connect();

VixHandle hostHandle = VIX_INVALID_HANDLE;
VixHandle jobHandle = VIX_INVALID_HANDLE;
VixHandle vmHandle = VIX_INVALID_HANDLE;
VixError err;

char *vmxPath;char vmx100;char hostname100;
int check;

int main(int argc, char * argv[])
{

check=connect(); if(check) { printf(" COnnect Failed! Error code :%d\n",check);goto abort;} else printf(" Connected to %s\n","https://xxxx.xxx.com/sdk");

}

int connect()
{

bq. jobHandle = VixHost_Connect(VIX_API_VERSION,
VIX_SERVICEPROVIDER_VMWARE_SERVER,
"https://xxxx.xxx.com/sdk", // hostName
0, // hostPort
"username", // userName
"pswxxx", // password,
0, // options
VIX_INVALID_HANDLE, // propertyListHandle
NULL, // callbackProc
NULL); // clientData
err = VixJob_Wait(jobHandle,
VIX_PROPERTY_JOB_RESULT_HANDLE,
&hostHandle,
VIX_PROPERTY_NONE);
if (VIX_OK != err) {
return err;

}
return 0;
}


end code


I tried using VIX1.7 but I got the same error (number 3). Please, Can you help?

Mic

Re: Error code 3 return from VixHost_Connect()

1. Oct 28, 2009 10:33 AM in response to: mic21
Click to view lemke's profile Hot Shot 183 posts since
Mar 30, 2006

VIX_SERVICEPROVIDER_VMWARE_SERVER means Server 1.0. You want VIX_SERVICEPROVIDER_VMWARE_VI_SERVER.


Developer Social Media

Communities