Hi,
I recently started programming using the vCloud SDK for .NET, version 5.5. Currently, I'm experiencing problems with my first application, which is written to do the following:
1. Log in using vCloudClient and username@organization (Succeeds).
2. Get organizations using GetOrgRefs, then GetOrganizationByReference on each organization (Succeeds).
3. Get vDCs using Organization.GetVdcRefs, then Vdc.GetVdcByReference on each vDC (Succeeds).
4. Get vApps using Vdc.GetVappRefs, then Vapp.GetVappByReference (Fails).
When I call "Vapp.GetVappByReference", one-third of the vApps in vCloud return either this error:
com.vmware.vcloud.sdk.utility.VCloudException: There is an error in XML document (220, 40).
at com.vmware.vcloud.sdk.Vapp.GetVappByReference(vCloudClient client, ReferenceType vappRef)
at Cloud.Fetch.Statistics(Object clientObj)
Or this error:
com.vmware.vcloud.sdk.utility.VCloudException: There is an error in XML document (219, 54).
at com.vmware.vcloud.sdk.Vapp.GetVappByReference(vCloudClient client, ReferenceType vappRef)
at Cloud.Fetch.DatacenterStatistics(Object clientObj)
Where the character number is always either 40 or 54.
Here is the code I'm running to encounter this problem:
// Get a list of all virtual datacenters in the organization:
List<ReferenceType> vdcReferences = organization.GetVdcRefs();
foreach (var vdcReference in vdcReferences)
{
// Fetch information about the virtual datacenter and save it to SQL Server:
Vdc vdc = Vdc.GetVdcByReference(client, vdcReference);
// Get a list of all virtual applications in the virtual datacenter:
List<ReferenceType> vAppReferences = vdc.GetVappRefs();
foreach (var vAppReference in vAppReferences)
{
Console.WriteLine(" Fetching {0}...", vAppReference.name);
try { Vapp vapp = Vapp.GetVappByReference(client, vAppReference); } // Problem
catch (Exception e) { Console.WriteLine(e); }
}
}
Any insight that anyone might have into why this is happening would be great.
I'm using Visual Studio 2013, Target platform x86.
Thanks.
↧
GetVappByReference Results in "There is an error in XML document" VCloudException
↧