public ManagedObjectReference SearchDatastore_Task(string datastorePath, HostDatastoreBrowserSearchSpec searchSpec)
        {
            ManagedObjectReference result;

            try
            {
                SearchDatastoreRequestType searchDatastoreRequestType = new SearchDatastoreRequestType();
                searchDatastoreRequestType._this         = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(this.MoRef);
                searchDatastoreRequestType.datastorePath = datastorePath;
                searchDatastoreRequestType.searchSpec    = (VimApi_65.HostDatastoreBrowserSearchSpec)VIConvert.ToWsdlType(searchSpec);
                result = (ManagedObjectReference)VIConvert.ToVim(this.VimServiceProxy.SearchDatastore_Task(new SearchDatastore_TaskRequest(searchDatastoreRequestType)).SearchDatastore_TaskResponse.returnval);
            }
            catch (FaultException ex)
            {
                throw FaultUtility.HandleFault(ex);
            }
            return(result);
        }
 public HostDatastoreBrowserSearchResults[] SearchDatastoreSubFolders(string datastorePath, HostDatastoreBrowserSearchSpec searchSpec)
 {
     HostDatastoreBrowserSearchResults[] result;
     try
     {
         ManagedObjectReference taskReference = this.SearchDatastoreSubFolders_Task(datastorePath, searchSpec);
         result = (HostDatastoreBrowserSearchResults[])this.Client.WaitForTask(taskReference);
     }
     catch (FaultException ex)
     {
         throw FaultUtility.HandleFault(ex);
     }
     return(result);
 }