Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2022-03-30 05:27 PM - edited 2022-03-30 05:31 PM
I am creating my first Web Service API. I started out by taking one of the standard scripts for obtaining a session token and creating a PowerShell script:
When I execute this script instead of getting a session token I get:
If I look at the IIS Logs I see an entry
The timestamp matches up to the time of when I executed the PS Script. I am thinking that this is an IIS issue. Any hint of where I should start looking to get past this message?
Thanks,
2022-03-31 05:19 PM - edited 2022-03-31 05:20 PM
In the past, I've seen issues using your code sample when PowerShell tries connecting to a remote Archer web server or AWS instance via a custom port like https://localhost:50004/RSAarcher. I think a workaround I used may apply in your situation based on the tests done above. Please try the following code.
$apiUrl = $base_Url + "/ws/general.asmx?wsdl"
$ws = New-WebServiceProxy -Uri $apiUrl
$autoGenNamespace = $ws.GetType().Namespace + '.General'
$req = New-Object ($autoGenNamespace)
$req.Url = $apiUrl
$req.AllowAutoRedirect = $true
$req.Timeout = 60000
if ($userDomain -eq "") {
$SessionToken = $req.CreateUserSessionFromInstance($username, $instanceName, $password)
}
else {
$SessionToken = $req.CreateDomainUserSessionFromInstance($username, $instanceName, $password, $userDomain)
}
write-host "Session Token : $SessionToken" -ForegroundColor Yellow
2022-04-01 09:53 AM
Jeff,
That did it. Thank you very much.
2022-04-01 09:54 AM
David, thanks for your help. The code that Jeff sent worked.