【问题标题】:vSphere web-services sample fails with "The server sent HTTP status code 200: OK"vSphere Web 服务示例失败并显示“服务器发送 HTTP 状态代码 200:OK”
【发布时间】:2013-07-16 08:54:10
【问题描述】:

我想以编程方式从 vSphere/vCenter 部署 VM 模板,因此我从 VMware 下载了 SDK zip 并将 VMClone.java 从 Web 服务 sdk 复制到 Eclipse 项目中,并使用以下代码运行它:

String[] myargs = new String[12];
myargs[0] = "--url";
myargs[1] = "https://192.168.0.91:9443";
myargs[2] = "--username";
myargs[3] = "[myuser]";
myargs[4] = "--password";
myargs[5] = "[mypassword].";
myargs[6] = "--datacentername";
myargs[7] = "LaptopIkor";
myargs[8] = "--vmpath";
myargs[9] = "[datastore1]/liferayTomcat/liferayTomcat.vmx";
myargs[10] = "--clonename";
myargs[11] = "DriverCreation1";
com.vmware.vm.VMClone.main(myargs);

(这只是一个示例设置,所以上面的代码没有隐私问题) (是的,这段代码不是很好,只是为了测试)

但这会失败并显示以下消息/堆栈跟踪:

com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 200: OK
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.createResponsePacket(Unknown Source)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(Unknown Source)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(Unknown Source)
at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source)
at com.sun.xml.internal.ws.client.Stub.process(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)
at $Proxy35.retrieveServiceContent(Unknown Source)
at com.vmware.vm.VMCreate.connect(VMCreate.java:287)
at com.vmware.vm.VMCreate.main(VMCreate.java:1047)
at (my own class with above code) 

VMCreate 和使用 samples.jar 而不是复制源文件时也会发生这种情况。知道如何解决这个问题吗?

该 url 指向安装了 vCenter Server 的 win2008 服务器,包括 vSphere Web Client。

感谢您的帮助。

【问题讨论】:

  • 你是怎么解决的?

标签: java web-services templates virtual-machine vsphere


【解决方案1】:
myargs[1] = "https://192.168.0.91:9443";

尝试

myargs[1] = "https://192.168.0.91/sdk";

【讨论】:

    猜你喜欢
    • 2012-12-13
    • 1970-01-01
    • 2020-08-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多