2012-03-30 9 views
0

いずれかのRemedy Webサービスを使用しているときに、認証情報を挿入するのがかなり困難です。PowerShell + BMC 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'はhereです。

答えて

1

セッションで同じNamespace値を再使用すると、WebServiceProxyに報告されたバグがあります。これを打つ場合は、powershellを閉じて再度開くか、-Namespaceパラメータを使わないでください。

Microsoft Connectのバグレポートをご覧ください。

+0

この問題が修正されたかどうか、または回避策がありますか?リンクされたサイトはページが見つからないためにリダイレクトされます。 –