Error: Executed as user: ***\***. A job step received an error at line 14 in a PowerShell script. The corresponding line is '$resp = $webRequest.GetResponse()'. Correct the script and reschedule the job. The error information returned by PowerShell is: 'Exception calling "GetResponse" with "0" argument(s): "The remote server returned an error: (404) Not Found." '. Process Exit Code -1. The step failed.


History: canvas planner has been reinstalled and pointing to another port number.


Solution: right click on the Load job -> Properties -> Deploy -> Edit -> change the port number from the script

Example: $ErrorActionPreference = "Stop"

[System.Net.WebRequest]$webRequest = [System.Net.WebRequest]::Create("http://localhost:81/Callisto_Server/callistoadmin.asmx/DeployApplication2")

$webRequest.UseDefaultCredentials = $true

$webRequest.PreAuthenticate = $true

$webRequest.ContentType = "application/x-www-form-urlencoded"

$webRequest.Timeout = 900000

$webRequest.Method = "POST"

$enc = [System.Text.Encoding]::GetEncoding("UTF-8")

[byte[]]$bytes = $enc.GetBytes("sAppLabel=pcDATA_EFP")

$webRequest.ContentLength = $bytes.Length

[System.IO.Stream]$reqStream = $webRequest.GetRequestStream()

$reqStream.Write($bytes, 0, $bytes.Length)

$reqStream.Flush()

$resp = $webRequest.GetResponse()

$rs = $resp.GetResponseStream()

[System.IO.StreamReader]$sr = New-Object System.IO.StreamReader -argumentList $rs

$statusCode = [int]$resp.StatusCode

if ($statusCode -eq 200) {

    [xml]$res = $sr.ReadToEnd()

    if ($res.error -ne $null) { Write-Error($res.error.msg) }

    else { Write-Output($res.InnerXml) }

}

else {

    Write-Error($statusCode.ToString() + "-" + $resp.StatusCode + "`n" + $sr.ReadToEnd())

}