How to use powershell to call a WCF service

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Tyler Rademacher Tyler Rademacher 10 months, 1 week ago.

  • Author
  • #33261
    Profile photo of Tyler Rademacher
    Tyler Rademacher

    I am attempting to new-webserviceproxy to use an internal web service to update a ticket in our SeviceNow instance. I can read the new proxy as I can run get-member from it. However, when I try to pass info to it that I want it to update I get an error: "SOAP header action was not understood". I've done some extensive checking online and can't seem to find a relevant answer. Is it possible to use powershell like this?

  • #33265
    Profile photo of Dave Wyatt
    Dave Wyatt

    Tricky to answer without more details. As long as ServiceNow is providing a proper SOAP endpoint, then it should be possible to do whatever you need to do starting with New-WebServiceProxy, but the steps after that may be tricky.

  • #33268
    Profile photo of Tyler Rademacher
    Tyler Rademacher

    From what I understand, this is all I should need:

    $SN = New-WebServiceProxy –Uri '' -UseDefaultCredential

    $SN.UpdateCatalogTask($null,$null,$null,$null,$null) # order of items to update (number,state,description,work_notes,assigned to)

    but get:

    Exception calling "UpdateCatalogTask" with "5" argument(s): "SOAP header Action was not understood."
    At line:7 char:1
    + $SNInt.UpdateCatalogTask($null,$null,$null,$null,$null)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : SoapHeaderException

    Thank you for the help!!

You must be logged in to reply to this topic.