VMware {code} Community
Chandrashekhar
Contributor
Contributor

How to start programming in VI SDK 2.5?

Hello everyone,

I am want to write code using VI SDK API. I have downloaded the API but im not able to do anything with it. I cant run sample programs and cant run simple program which I have written.

I have downloaded SDK 2.5, apache axis 1.4 , certificates also. I have created keystore for certificates. I am using linux. My path variables are as follows :

VMKEYSTORE=/home/shekhar/viApp/VMKEYSTORE/vmware.keystore

JAVAHOME=/usr/lib/jvm/java-6-sun-1.6.0.10/bin

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/shekhar/viApp/axis/lib:/usr/lib/jvm/java-6-sun-1.6.0.10/bin

SDKHOME=/home/shekhar/viApp/VISDK

WSDLFILE=/home/shekhar/viApp/VISDK/wsdl/vim25

CLASSPATH=/home/shekhar/viApp/axis/lib/axis.jar:/home/shekhar/viApp/axis/lib/axis-ant.jar:/home/shekhar/viApp/axis/lib/commons-discovery-0.2.jar:/home/shekhar/viApp/axis/lib/commons-logging-1.0.4.jar:/home/shekhar/viApp/axis/lib/jaxrpc.jar:/home/shekhar/viApp/axis/lib/log4j-1.2.8.jar:/home/shekhar/viApp/axis/lib/saaj.jar:/home/shekhar/viApp/axis/wsdl4j-1.5.1.jar:/home/shekhar/viApp/VISDK/samples/Axis/java/vim.jar:/home/shekhar/viApp/VISDK/samples/Axis/java/lib/activation.jar:/home/shekhar/viApp/VISDK/samples/Axis/java/lib/mailapi.jar

AXISHOME=/home/shekhar/viApp/axis

Am I missing anything? I tried to use build.sh and run.sh files but it gives me following error.

: not found:

build.sh: 28: Syntax error: word unexpected (expecting "do")

What shoud I do to remove this error?

And one stupid question !! why it is necessay to build the files again? Cant we use already available jar files?

Thanks in advance.

Reply
0 Kudos
6 Replies
Steve_Jin
Expert
Expert

Check out the VI Java API 2.0, which does NOT require AXIS any more. Here is a tutorial to get your first app running in 5 minutes:

http://communities.vmware.com//thread/196880?tstart=0

Steve JIN, VMware Engineering

Creator of VMware Infrastructure Java API. VI Java API 2.0 --- 15 times faster than AXIS in loading, 4+ faster in deserialization; only 1/4 of the size required by AXIS. More importantly, the freedom to redistribute it with your applications. (Download, Samples, DocWiki, RSS Feed)

Get Connected with Other Developers in the Community?

Steve JIN Author of VMware VI and vSphere SDK; Creator of open source VI Java API (http://vijava.sf.net); Blogger at http://www.doublecloud.org
Reply
0 Kudos
Chandrashekhar
Contributor
Contributor

Project specification says I have to use VI SDK 2.5 only. Can you please tell solution for my problem?

Reply
0 Kudos
Steve_Jin
Expert
Expert

The core of VI SDK 2.5 is the SOAP based Web Service interfaces defined in WSDL. It's NOT equal to AXIS which is used as an example. You can use whatever Web Service engine as long as it comply with the WSDL.

Now come back to your problem as it was, you can use the compiled vim25.jar. No need to rebuild your jar from wsdl again. So you can just skip this problem.

Steve JIN, VMware Engineering

Creator of VMware Infrastructure Java(Jython) API. VI Java API 2.0 --- 15 times faster than AXIS in loading, 4+ faster in deserialization; only 1/4 of the size required by AXIS. More importantly, the freedom to redistribute it with your applications. (Download, Samples, DocWiki, RSS Feed)

Get Connected with Other Developers in the Community?

Steve JIN Author of VMware VI and vSphere SDK; Creator of open source VI Java API (http://vijava.sf.net); Blogger at http://www.doublecloud.org
Chandrashekhar
Contributor
Contributor

Thanks Steve.

I solved the problem of build.sh file. The file was containing " ^M " special charatcher at the end of each line. I think that was the cause of error. I removed that special character from each file, and build.sh file ran successfully.

Reply
0 Kudos
Chandrashekhar
Contributor
Contributor

Thanks Steve.

I solved the problem of running build.sh file. This file was having " ^M " special character at the end of each line.Earlier I was opening that file in gedit, but when I opened it using vim then only I saw this special character. I think that special character was root of problem. I removes ^M from each file, saved it and tried to run, it worked. It has generated stub and all.

Reply
0 Kudos
Chandrashekhar
Contributor
Contributor

Thanks Steve.

I solved the problem of running build.sh file. This file was having " ^M " special character at the end of each line.Earlier I was opening that file in gedit, but when I opened it using vim then only I saw this special character. I think that special character was root of problem. I removes ^M from each file, saved it and tried to run, it worked. It has generated stub and all.

Reply
0 Kudos