Active IQ Unified Manager Discussions
Active IQ Unified Manager Discussions
Hi WFA gurus,
I am invoking a WFA workflow using Invoke-RestMethod in PSv3/PSv4. When I invoke the script to call the workflow via rest it fails with the following error.
PS H:\> Invoke-Rest.ps1
Invoke-RestMethod : The remote server returned an error: (505) Http Version Not Supported.
At H:\Invoke-Rest.ps1:58 char:22
+ [xml]$executionXML = Invoke-RestMethod -Method Post -Credential $credential -Uri ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Where as if invoke the workflow with postman rest client and then run the same script it works perfectly fine.
So not sure what is the difference and the cause when its invoked via PS for the first time.
Anyone encountered this earlier ?
BTW here is the snippet of my invoke
[xml]$executionXML = Invoke-RestMethod -Method Post -Credential $credential -Uri $workflowExecutionUri -body $XMLObject -ContentType "application/xml"
Regards
Adai
Solved! See The Solution
This error is normally not seen with Invoke-RestMethod. But, if its has, you can try this. Type the below line before calling the Invoke-RestMethod.
[System.Net.ServicePointManager]::Expect100Continue = $false
sinhaa
This error is normally not seen with Invoke-RestMethod. But, if its has, you can try this. Type the below line before calling the Invoke-RestMethod.
[System.Net.ServicePointManager]::Expect100Continue = $false
sinhaa
Hi Sinha,
Thanks this seems to work. Will update if there is any failure during the course of testing.
Regards
Adai
Adai,
Are you using HTTP or HTTPS to connecto to the WFA server for the REST operatoin?
Andrew
Hi Andrew,
I am using http and not https.
Regards
Adai