在使用任何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“类型。”...um...什么?如何对此进行故障排除?
如果有人有想法,我洗耳恭听。
函数'New-WebServiceProxy‘可以在here中找到。
发布于 2013-02-14 08:37:58
在会话中重用相同的Namespace值时,WebServiceProxy上报告了一个错误。如果你遇到这个问题,你可以关闭然后重新打开powershell,或者避免使用-Namespace参数。
请参阅Microsoft Connect上的错误报告。
https://stackoverflow.com/questions/9947371
复制相似问题