vSphere Web Services SDK 安装【转发】_JAVA_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > JAVA > vSphere Web Services SDK 安装【转发】

vSphere Web Services SDK 安装【转发】

 2014/12/4 15:44:03  huanggua12353719  程序员俱乐部  我要评论(0)
  • 摘要:TheVMwarevSphereWebServicesSDKincludesallthecomponentsnecessarytoworkwiththeVMwarevSphereAPI,includingWSDLfiles,samplecode,andlibraries.ThevSphereWebServicesSDKfacilitatesdevelopmentofclientapplicationsthattargettheVMwarevSphereAPI
  • 标签:SDK Web Service 安装

The VMware vSphere Web Services SDK includes all the components necessary to work with the VMware vSphere API, including WSDL files, sample code, and libraries. The vSphere Web Services SDK facilitates development of client applications that target the VMware vSphere API. With the vSphere Web Services SDK, developers can create client applications to manage, monitor, and maintain VMware vSphere components, as deployed on VMware?VMware vSphere?ESX?, ESXi?, and VMware?vCenter? Server systems. 这是官方对vSphere Web Services SDK的介绍,简单来说就是提供了管理vcenter,ESXi的程序接口,目前支持JAVA和.NET平台,下面以windows 7平台为例,介绍JAVA开发环境的部署过程 一、开发环境准备

1、安装JAVA开发环境 J2SE 1.6 b22 http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jdk-6u22-oth-JPR 安装到c:\java下,不要安装到C:\program files下,目录中有空格,执行脚本的时候会报错

2、安装SOAP工具JAX-WS2.1

http://jax-ws.java.net/2.1.1/index.html 双击安装即可

3、下载vSphere Web Services SDK 5.1 http://communities.vmware.com/community/vmtn/developer/downloads 解压到c:\devprojects下

二、开发环境配置

1、设置系统变量 JAVA_HOME=C:\java\jdk1.6.0_22 JAVAHOME=C:\java\jdk1.6.0_22 SDKHOME=C:\devprojects VMKEYSTORE=C:\VMware-Certs\vmware.keystore(稍后介绍安装过程) WEBHOME=C:\devprojects\vsphere-ws\java\Axis\lib\wbem.jar WS_SDK_HOME=C:\devprojects\SDK\vsphere-ws CLASSPATH=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;C:\devprojects\SDK\vsphere-ws\java\JAXWS\lib\samples.jar;C:\devprojects\SDK\vsphere-ws\java\JAXWS\lib\vim25.jar(这个变量很重要)

2、服务器认证

2.1、将ESX Server或Vcenter的证书导入本机,ESXi的证书在/etc/vmware/ssl/rui.crt;Vcenter的证书在C:/Documents and Settings/All Users/Application Data/VMware/VMware VitualCenter/SSL/rui.crt

2.2、证书拷贝到本机的C:/VMware-Certs目录下,打开windows7的命令行界面,切换到C:/VMware-Certs目录下,使用jdk的keytool工具导入证书: keytool -import -file -alias -keystore vmware.keystore 其中certificate-filename为rui.crt,service-name可以为服务器的机器名或IP地址,运行成功后会在C:/VMware-Certs目录下生成vmware.keystore文件。

3、重新编译JAX-WS 如果你的安装的版本不是JDK 1.6 b22或者SOAP不是用 JAX-WS2.1,就需要重新编译 打开CMD,切换到C:\devprojects\SDK\vsphere-ws\java\JAXWS\ 运行build.bat 运行成功会出现会出现 Generating stubs from wsdl Compiling stubs. ... Done

三、运行简单的客户端脚本以验证安装成功 打开CMD,切换到C:\devprojects\SDK\vsphere-ws\java\JAXWS\ run.bat com.vmware.general.SimpleClient --urlhttps://yourFQDNservername/sdk --username username --password password,如下输出表示配置SDK成功



?

四、错误调试 1、如果出现找不到类的错误,ClassNotFoundException:........,可以这样 打开CMD,切换到C:\devprojects\SDK\vsphere-ws\java\JAXWS\ java -Djavax.net.ssl.trustStore=%VMKEYSTORE% com.vmware.general.SimpleClient--url https://example.com/sdk --username pubs --password *** 2、如果提示JAVA虚拟机的内存不够,可以这样 java -Djavax.net.ssl.trustStore=%VMKEYSTORE% -Xms 512M -XMx1024M com.vmware.general.SimpleClient--url https://example.com/sdk --username pubs --password ***

  • class='magplus' title='点击查看原始大小图片' />
  • 大小: 19.8 KB
  • 查看图片附件
发表评论
用户名: 匿名