因此,在PowerShell中通过WSDL SOAP提交内容时出现转换错误。 我试图在一个名为Kablink的系统中创建条目,但是当我尝试实际创建时,条目具有变量$ soapData中的所有值等,我得到一个错误,即无法将参数条目从一个值转换为另一个值指定的值是相同的。
Cannot convert argument "entry", with value: "folder_addEntry.FolderEntry", for "folder_addEntry" to type "folder_addEntry.FolderEntry": "Cannot convert the "folder_addEntry.FolderEntry" value of type
"folder_addEntry.FolderEntry" to type "folder_addEntry.FolderEntry"."
任何想法都会受到极大的赞赏,因为这让我感到疯狂。
以下是我正在使用的脚本
$kablinkSoapUrl = "http://servername/ssr/secure/ws/TeamingServiceV1?wsdl"
$kablinkConnector = New-WebServiceProxy -Uri $kablinkSoapUrl -Credential $Credential -namespace "folder_addEntry"
#Set Binder ID to Shift Rota entries folder
$binderID = 155
#write-host $soapData
#Import Objects and Populate Default Values
$soapDescription = New-Object ("folder_addEntry.Description")
$soapDescription.text = "Some Description"
$soapDescription.format = 0
$soapAttachment = New-Object("folder_addEntry.attachmentsField")
$soapAttachment.name = ""
$soapAttachment.type = ""
$soapAttachment.attachments = @()
$soapCreate = New-Object ("folder_addEntry.Timestamp")
$soapCreate.date = get-date
$soapCreate.principal = ""
$soapCreate.principalId = 2
$soapModify = New-Object ("folder_addEntry.Timestamp")
$soapModify.date = get-date
$soapModify.principal = ""
$soapModify.principalId = 2
$soapRating = New-Object ("folder_addEntry.AverageRating")
$soapRating.averageRating = ""
$soapRating.ratingCount = ""
$soapCustBool = New-Object ("folder_addEntry.CustomBooleanField")
$soapCustBool = @()
$soapCustDate = New-Object ("folder_addEntry.CustomDateField")
$soapCustDate = @()
$soapCustEven = New-Object ("folder_addEntry.CustomEventField")
$soapCustEven = @()
$soapCustLong = New-Object ("folder_addEntry.CustomLongArrayField")
$soapCustLong = @()
$soapCustStriArr = New-Object ("folder_addEntry.CustomStringArrayField")
$soapCustStriArr = @()
$soapCustStr = New-Object ("folder_addEntry.CustomStringField")
$soapCustStr = @()
#Construct Entry
$soapData = New-Object -TypeName folder_addEntry.FolderEntry
$soapData.attachmentsField = $soapAttachment
$soapData.averageRating = $soapRating
$soapData.creation = $soapCreate
$soapData.customBooleanFields = $soapCustBool
$soapData.customDateFields = $soapCustDate
$soapData.customEventFields = $soapCustEven
$soapData.customLongArrayFields = $soapCustLong
$soapData.customStringArrayFields = $soapCustStriArr
$soapData.customStringFields = $soapCustStr
$soapData.definitionId = "8a8ab38c62d40d5c0162fc8330eb01ad"
$soapData.description = $soapDescription
$soapData.entityType = "fileEntry"
$soapData.eventAsIcalString = 0
$soapData.family = "file"
$soapData.id = ""
$soapData.modification = $soapModify
$soapData.parentBinderId = 155
$soapData.permaLink = ""
$soapData.title = "PowerShell Entry"
$soapData.docLevel = 1
$soapData.docNumber = ""
$soapData.href = ""
$soapData.preDeleted = 0
$soapData.preDeletedBy = ""
$soapData.preDeletedWhen = ""
$soapData.reservedBy = ""
$soapData.workflows = @()
# Print Soap Data
$soapData
# Submit Entry
$kablinkConnector.folder_addEntry("",$soapData,"")
提前致谢。
答案 0 :(得分:0)
添加-class" folder_getEntry"在创建$ kablinkConnector变量时创建行
UPDATE tblPopUp
SET PopUp = 'False', Period = Period
OUTPUT DELETED.Period
WHERE DisplayNo = 1
现在可行了