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.