IT Process Automation

 View Only
  • 1.  Consuming ITPA web service in .net

    Posted Mar 25, 2011 06:40 AM
    I am trying to write a .net application which will consume the IT PA web services.

    Initially I want to be able to check the status of a process, unfortunatley I have not got very far.

    .Net creates proxy classes when you reference a web service and I am having problems with creating the Auth object to pass into my call.

    Does anyone have experience of using IT PA in .net?

  • 2.  RE: Consuming ITPA web service in .net

    Posted Feb 27, 2013 10:57 AM
    Can anyone help here please?

    I am re-visiting this and would really like to get this working.
    I am sure it is something simple.

  • 3.  RE: Consuming ITPA web service in .net

    Posted Feb 27, 2013 11:23 AM

    We're calling the executeProcess method from a C# exe and a powershell script.
    Here's the C# version - it does some other stuff to pass PARMs to the process, you can ignore all of that.
    Let me know if you need the powershell version.

    [font=Courier New]/// importing namespaces
    using System;
    using System.Net;
    using System.Xml;

    namespace ITPAM_WebService
    static class Program
    static void Main()

    //Get current UTC time and get end time by adding 30min to it
    DateTime nowUTC;
    DateTime endUTC;
    nowUTC = DateTime.UtcNow;
    endUTC = nowUTC.AddMinutes(30);
    String nowUTCString = String.Format("{0:yyyy/MM/dd HH:mm}", nowUTC);
    String endUTCString = String.Format("{0:yyyy/MM/dd HH:mm}", endUTC);

    //Get AD Domain and hostname
    char[] delimiters = new char[] { '.' };
    String completeDomain = System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().DomainName;
    String[] domainName = completeDomain.Split(delimiters);
    String hostName = System.Net.Dns.GetHostName();

    // Prepare SOAP URL
    String SoapURL = "<PAM Orchestrator URL>";
    String soapString = @"
    <soapenv:Envelope xmlns:soapenv="""" xmlns:itp="""">
    <itp:name><Process Name></itp:name>
    <!--You have a CHOICE of the next 2 items at this level-->
    <!--1 or more repetitions:-->
    <itp:param name=""ipType"">ITMMaint</itp:param>
    <itp:param name=""ipName"">";
    String soapIP = @"</itp:param>
    <itp:param name=""ipRegion"">";

    String soapIPStart= @"</itp:param>
    <itp:param name=""ipStart"">";

    String soapIPEnd = @"</itp:param>
    <itp:param name=""ipEnd"">";

    String soapEnd = @"</itp:param>
    <itp:param name=""ipUseTZ"">No</itp:param>
    <itp:param name=""ipFrequency"">Once</itp:param>
    <itp:param name=""ipComments""><Comments></itp:param>

    String soapRequestString = soapString + hostName + soapIP domainName[0] soapIPStart nowUTCString soapIPEnd endUTCStringsoapEnd;

    // Execute SOAP Request

    Console.WriteLine("Sending SOAP Request To Server: " + SoapURL);
    var soapWebRequest = System.Net.WebRequest.Create(SoapURL);
    soapWebRequest.Headers.Add("SOAPAction", "\"ExecuteC2OFlow\"");
    soapWebRequest.ContentType = "text/xml;charset=\"utf-8\"";

    Console.WriteLine("Initiating Send...");

    XmlDocument soapEnvelop = new XmlDocument();

    var requestStream = soapWebRequest.GetRequestStream();

    Console.WriteLine("Send Complete, Waiting For Response.");
    var resp = soapWebRequest.GetResponse();
    var responseStream = resp.GetResponseStream();
    System.IO.StreamReader soapReader = new System.IO.StreamReader(responseStream);


  • 4.  RE: Consuming ITPA web service in .net

    Posted Feb 27, 2013 12:36 PM

    thanks for sharing!

  • 5.  RE: Consuming ITPA web service in .net

    Posted Feb 27, 2013 01:06 PM
    Thanks Jon,

    I am attempting to do it in a different way, by consuming the web service as a service reference, then using the following:

    My problem is I am trying to convert it into and having problems around the creation of the auth object.
    Itpam.ItpamServiceSoapClient TfS = new Itpam.ItpamServiceSoapClient(); // Initialize
    Itpam.flow UpdateClientDataFlow = new Itpam.flow() // create flow
    name = "/ProcessName",
    action = "Start",
    auth = new Itpam.auth()
    ItemsElementName = new Itpam.ItemsChoiceType[]
    Items = new string[]
                        @params = new Itpam.param[]
    new Itpam.param()
    name = "Message",
    Value = "TestMessage"
                        options = new Itpam.options()
    priority = "1"
    TfS.ExecuteProcess(UpdateClientDataFlow); // execute 
    Anyone care to translate?

  • 6.  RE: Consuming ITPA web service in .net

    Posted Feb 27, 2013 01:13 PM
    Awesome! It would be great if share powershell script.

    thanks in advance


  • 7.  Re: Consuming ITPA web service in .net

    Posted Jun 24, 2014 01:20 AM