0

在使用任何 Remedy Web 服务时,我在插入身份验证信息时遇到了相当大的困难。

$URL = "https://itsm.url.com/arsys/WSDL/public/server_name/HPD_IncidentInterface_WS";
$URI = New-Object System.Uri($URL);
$ITSM = New-WebServiceProxy -Uri $URI -Namespace ITSM;
$Credentials = New-Object ITSM.AuthenticationInfo;
$Credentials.userName = "UserName";
$Credentials.password = "PassworD";
$Credentials.authentication = '';
$ITSM.AuthenticationInfoValue = $Credentials;

代码在最后一行显示。这是生成的错误消息:

Exception setting "AuthenticationInfoValue": "Cannot convert the "ITSM.AuthenticationInfo" value
of type "ITSM.AuthenticationInfo" to type "ITSM.AuthenticationInfo"."
At C:\\ITSM Automation\Automate Incident Modification.ps1:45 char:8
+     $ITSM. <<<< AuthenticationInfoValue = $Credentials;
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyAssignmentException

“无法将“ITSM.AuthenticationInfo”类型的“ITSM.AuthenticationInfo”值转换为“ITSM.AuthenticationInfo”类型。” ...嗯什么?如何解决这个问题?

如果有人有想法,我会全力以赴。

可以在此处找到函数“New-WebServiceProxy” 。

4

1 回答 1

1

在会话中WebServiceProxy重新使用相同的值时报告了一个错误。Namespace如果您遇到此问题,您可以关闭并重新打开 powershell,或者避免使用该-Namespace参数。

请参阅Microsoft Connect上的错误报告。

于 2013-02-14T00:37:57.530 回答