Menu

#141 Provides support for vCenter 5.1 within the 5.0 API

closed-out-of-date
Steve
API (125)
5
2012-10-03
2012-05-25
Holly Harb
No

With the fix described below, there can be support for vSphere 5.1/vCenter 5.1 in vijava.

In vSphere 5.1 the default SOAP_ACTION header becomes 4.0 in vijava since there is no check for 5.1. This will cause failures on a number of methods
that were available or were revised in 5.0 when the soap xml gets sent to the server.

SOAPAction: "urn:internalvim25/4.0"

Creating a SOAP ACTION header of 5.1 does not solve the problem. When WSClient gets invoked it gets confused and will give a service manager
failure.

java.rmi.RemoteException: Exception in WSClient.invoke:; nested exception is:
java.lang.NoSuchFieldException: serviceManager
at com.vmware.vim25.ws.WSClient.invoke(Unknown Source)
at com.vmware.vim25.ws.VimStub.retrieveServiceContent(Unknown Source)
at com.vmware.vim25.mo.ServiceInstance.<init>(Unknown Source)
at com.vmware.vim25.mo.ServiceInstance.<init>(Unknown Source)

To fix this and provide support for vSphere 5.1, in the following method of WSClient.java, update the header to use 5.0 for vSphere 5.1

public void setSoapActionOnApiVersion(String apiVersion)
{
//4.0 is set by default already, so skip it here
if("4.1".equals(apiVersion))
{
soapAction = SOAP_ACTION_V41;
}
else if("5.0".equals(apiVersion))
{
soapAction = SOAP_ACTION_V50;
}
else if ("5.1".equals(apiVersion)){
soapAction = SOAP_ACTION_V50;
}
}

Thanks! I hope you can use this!

Holly Harb

Discussion

  • Steve

    Steve - 2012-10-03

    Thanks Holly, the 5.1 beta is out and I am closing this bug.

    Steve http://www.doublecloud.org

     
  • Steve

    Steve - 2012-10-03
    • status: open --> closed-out-of-date