search cancel

Can we use Microsoft Windows PowerShell to interact with the CA Service Desk Manager (CA SDM) SOAP based Web Services API?


Article ID: 49239


Updated On:


CA IT Asset Manager CA Software Asset Manager (CA SAM) ASSET PORTFOLIO MGMT- SERVER SUPPORT AUTOMATION- SERVER CA Service Desk Manager - Unified Self Service CA Service Desk Manager CA Service Management - Asset Portfolio Management CA Service Management - Service Desk Manager



Some customers may want to monitor the status of the CA SDM service to make sure it is up and running.

Some monitoring software can execute PowerShell scripts. This document provides a very basic example on how to do that.


This document assumes you have some knowledge of Windows PowerShell and the CA Service Desk Manager Web Services API.

CA Support provides this document as an example with no guarantees. CA Support will not assist you with PowerShell. However, we can assist with any queries related to the Service Desk SOAP based Web Services API.


  • Windows Operating System that supports PowerShell 3.0 or later
  • Microsoft Windows PowerShell 3.0 or later on your remote host (where you plan to execute the script)
  • Location of your CA SDM SOAP Web Services WSDL, for example:


Microsoft Documentation:

  1. Confirm you have the command-let Invoke-WebRequest

    For example, you can run:
    PS C:\Users\administrator> Get-Help Invoke-WebRequest

  2. Create an input file for the XML:
         mkdir c:\temp     notepad soap.txt     Place contents like the following in the soap.txt file (assuming you are calling login()        <?xml version = "1.0" ?>	       <soap:Envelope xmlns:soap=""	            xmlns:xsi=""	            xmlns:xsd="">	        <soap:Body>	        <login xmlns="">	     <username>ServiceDesk</username>	     <password>Passwordr11</password>	   </login>	   </soap:Body>	  </soap:Envelope>	

  3. Run the following code in PowerShell, adjust for your environment ( commands are italicized below)

    First we need to define a HTTP Header Key Value Pair for SoapAction:
        PS C:\Users\administrator> $SoapAction = New-Object "System.Collections.Generic.Dictionary''2[System.String,System.String]"
    PS C:\Users\administrator> $SoapAction.Add("SOAPAction", "")

    Verify the values:
        PS C:\Users\administrator> $SoapAction 
    Key Value --- -----

    This command should appear on one line:

    PS C:\Users\administrator> Invoke-WebRequest http://localhost:2000/axis/services/USD_R11_WebService?wsdl -Method Post -Content
    Type "text/xml" -Headers $SoapAction -InFile C:\Temp\soap.txt -OutFile c:\Temp\soapRes.txt

  4. Verify the results in the soapRes.txt output file, they should look like the following:
        <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv=""    xmlns:xsd="" xmlns:xsi=""><soapenv:Body>    <loginResponse	xmlns=""><loginReturn	   xmlns="">713249330</loginReturn></loginResponse></soapenv:Body></soapenv:Envelope>

    In this example 713249330 is the session id, which means a successful login.

    This document is provided with no guarantees and only offered as a sample.


Release: UAPMAC990JPP-12.6-Asset Portfolio Management-Asset Configuration