ReportingService2005.FindItems () da'vat qiluvchi xato; Ayniqsa, BooleanOperatorEnum parametr bilan bog'liq

ReportingService2005.FindItems() metodini powershell v2 ichidan chaqiradigan muammolarga ega.

$rs = New-WebServiceProxy -Uri $ReportServerUri -Namespace SSRS.ReportingService2005 -UseDefaultCredential;

$searchCondition = New-Object SSRS.ReportingService2005.SearchCondition
$searchCondition.ConditionSpecified  = $true
$searchCondition.Name = "Name";
$searchCondition.Value = "Sales";
[SSRS.ReportingService2005.SearchCondition[]] $searchConditions = @($searchCondition)

$boolOp = [SSRS.ReportingService2005.BooleanOperatorEnum]::And

#Also tried bellow initialization of enum.
#[SSRS.ReportingService2005.BooleanOperatorEnum] $boolOp = 0

$rs.FindItems("/", $boolOp ,$searchConditions)

Yuqoridagi amallarni bajarish quyidagi xatolarni keltirib chiqaradi:

"SSRS.ReportingService2005.BooleanOperatorEnum" ni yozish uchun "FindItems" uchun "Va" argumenti "1" qiymatini o'zgartira olmaydi: "SSRS.ReportingService2005.BooleanOperatorEnum" ni yozish uchun "Va" qiymatini o'zgartira olmaydi. " "SSRS.ReportingService2005.BooleanOperatorEnum" dan "SSRS.ReportingService2005.BooleanOperatorEnum" dan ".

Har qanday yordam katta taqdir bo'ladi, Zach

1

1 javoblar

Mening veb-protsessida ishlatiladigan nom maydoni paramateriga aloqador bo'lishi kerakligi aniqlandi. Qabul qilinganidek, mening skript, seansda mavjud bo'lmagan birinchi marta muvaffaqiyatli ishlaydi; bir xil vakolatlar majlisida ketma-ket o'qqa tutilishlarda muvaffaqiyatsizlikka uchraydi.

Found this article which explains the situation fairly well: http://www.vistax64.com/powershell/273120-bug-when-using-namespace-parameter-new-webserviceproxy.html

$rs = New-WebServiceProxy -Uri $ReportServerUri -UseDefaultCredential; 

$searchCondition = New-Object Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy1er_ReportService2005_asmx_WSDL.SearchCondition;
$boolop = New-Object Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy1er_ReportService2005_asmx_WSDL.BooleanOperatorEnum;
2
qo'shib qo'ydi