Quantcast
Channel: VMware Communities : Discussion List - Virtual Disk Development Kit
Viewing all articles
Browse latest Browse all 2039

GetVappByReference Results in "There is an error in XML document" VCloudException

$
0
0



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.


Viewing all articles
Browse latest Browse all 2039

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>