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 に答える