How do I get a workflow to run the HttpListener?

32 Views Asked by At

DESCRIPTION

I'm using

  • SharePoint Designer 2013
  • SharePoint 2019
  • Windows Server 2019

I found some code called HttpListener that is written in PowerShell. https://www.powershellgallery.com/packages/HttpListener/1.0.2/Content/HTTPListener.psm1

After I started the HttpListener function in the code I opened a browser to run the web service manually.
Example: http://localhost:8888/PowerShell?command=Jane.Doe&format=text As advertised, it created an active directory account. That is what I need it to do.

PROBLEM

The problem is I'm not able to get a SharePoint workflow for a list to do the same thing as running the web service in a browser window.

WHAT I TRIED

  1. I create a workflow for a list.
  2. In the workflow I created a single step where the only action is "Call HTTP Web Service".
  3. The values for the "Call HTTP Web Service" are as follows: (NOTE: I'm only sending data to the web service. I don't need anything back. If it sends something back, then that is fine. But, I don't need it.) 3.1. this = http://localhost:8888/PowerShell?command=John.Smith&format=text (Method = HTTP POST) 3.2. request = left empty 3.3. response = left empty 3.4. responseHeader = left empty 3.5. Variable: responseCode = left empty

Transition to Stage = End of Workflow.

I made sure the user account running the workflow in SharePoint had the same rights as the account running the web service in the browser.

WHAT WAS I EXPECTING

I was expecting the web service to work in the SharePoint workflow just like it did when I used the browser.

Any suggestions or alternatives?

0

There are 0 best solutions below