0

I'm having considerable difficulty inserting authentication information when using any of the Remedy web services.

$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;

The code dies on the last line shown. This is the error message generated:

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

"Cannot convert the "ITSM.AuthenticationInfo" value of type "ITSM.AuthenticationInfo" to type "ITSM.AuthenticationInfo"." ...um... What? How does one troubleshoot this?

If anyone has ideas, I'm all ears.

The function 'New-WebServiceProxy' can be found here.

Turranx
  • 1
  • 1
  • 2

1 Answers1

1

There is a bug reported on the WebServiceProxy when re-using the same Namespace value in a session. If you are hitting this, you can either close and re-open powershell, or avoid using the -Namespace parameter.

See the bug report on Microsoft Connect.

Scott Wegner
  • 7,263
  • 2
  • 39
  • 55