Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
(505) Http Version Not Supported error when invoking workflow via Invoke-RestMethod
2015-06-05
06:24 PM
8,811 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
1 ACCEPTED SOLUTION
AdaikkappanArumugam has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
4 REPLIES 4
AdaikkappanArumugam has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sinha,
Thanks this seems to work. Will update if there is any failure during the course of testing.
Regards
Adai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Adai,
Are you using HTTP or HTTPS to connecto to the WFA server for the REST operatoin?
Andrew
If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Andrew,
I am using http and not https.
Regards
Adai
