Active IQ Unified Manager Discussions

(505) Http Version Not Supported error when invoking workflow via Invoke-RestMethod

AdaikkappanArumugam

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

1 ACCEPTED SOLUTION

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 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

View solution in original post

4 REPLIES 4

asulliva

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.

Hi Andrew,

               I am using http and not https.

 

Regards

Adai

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 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

View solution in original post

Hi Sinha,

                  Thanks this seems to work. Will update if there is any failure during the course of testing.

 

Regards

Adai

Announcements
Register for Insight 2021 Digital

INSIGHT 2021 Digital: Meet the Specialists 2

On October 20-22, gear up for a fully digital, totally immersive virtual experience with a downright legendary lineup of world-renowned specialists. Tune in for visionary conversations, solution deep dives, technical sessions and more.

NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public