Re: Call HPOO Workflow through webservice? (3147 Views)
Reply
Occasional Contributor
wangyi0226
Posts: 7
Registered: ‎11-19-2010
Message 1 of 21 (3,316 Views)

Call HPOO Workflow through webservice?

hi all, is there a way to call the workflow through webservice? if not , how can i call the workflow out of the HPOO?
Thanks!!
Frequent Advisor
Milap
Posts: 60
Registered: ‎02-06-2012
Message 2 of 21 (3,170 Views)

Re: Call HPOO Workflow through webservice?

I am also searching for soemthing like this..

 

Did you get any clue?

 

Regards,

MIlap

Occasional Visitor
forcefx2
Posts: 2
Registered: ‎09-18-2012
Message 3 of 21 (3,162 Views)

Re: Call HPOO Workflow through webservice?

For quick testing I use powershell from my desktop using gnu wget and the UUID of the flow.

$myData = @' https://localhost:8443/PAS/services/rest/run_async/a51057c4-cc24-4e61-b462-e28f4f1c70d2?caseID=12345...] '@

wget -q -O $null --auth-no-challenge --no-check-certificate --http-user=OOUSER --http-password=OOUSERPASSWORD $myData

Frequent Advisor
Milap
Posts: 60
Registered: ‎02-06-2012
Message 4 of 21 (3,147 Views)

Re: Call HPOO Workflow through webservice?

Hi ,

 

I am trying to call it from HPSM.Is there any way for the same.

 

Warm regards,

Milap

Honored Contributor
Mahmoud Ibrahim
Posts: 1,574
Registered: ‎05-21-2008
Message 5 of 21 (3,121 Views)

Re: Call HPOO Workflow through webservice?

Hi Wan,

 

 

There is a method called runFlow under WSCentralService() function that can be called by OO webservice

 

 

____Example of runFlow___XML Template___

 

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsc="http://wscentralservice.services.dharma.iconclude.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
   <soapenv:Header/>
   <soapenv:Body>
      <wsc:runFlow soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <params xsi:type="soap:WSRunParameters" xmlns:soap="http://iconclude.com/webservices/rss/v2.0/soap">
            <async xsi:type="xsd:boolean">?</async>
            <flowInputs xsi:type="wsc:ArrayOf_tns1_WSFlowInput" soapenc:arrayType="soap:WSFlowInput[]" xmlns:wsc="https://localhost:8443/PAS/services/WSCentralService"/>
            <runName xsi:type="xsd:string">?</runName>
            <startPaused xsi:type="xsd:boolean">?</startPaused>
            <trackStatus xsi:type="xsd:boolean">?</trackStatus>
            <uuid xsi:type="xsd:string">?</uuid>
         </params>
      </wsc:runFlow>
   </soapenv:Body>
</soapenv:Envelope>

 

_____end_of_example___

 

I have exported the available functions runFlow and runFlowEx as OO operations in the attachment.

Regards,
Mahmoud Ibrahim
http://www.mahmoudthoughts.com
  • Say thanks by clicking the "Kudos! Star" which is on the left.

  • Make it easier for other people to find solutions, by marking my answer with "Accept as Solution" if it solves your issue.
  • Honored Contributor
    Mahmoud Ibrahim
    Posts: 1,574
    Registered: ‎05-21-2008
    Message 6 of 21 (3,120 Views)

    Re: Call HPOO Workflow through webservice?

    [ Edited ]

    Hi Milap,

    There are many ways to run workflow using URL

     

    1- Using its UUID

     

    https://<hostname>:<port>//PAS/services/rest/run/<UUID>

     

    Like

     

    https://localhost:8443/PAS/services/rest/run/503c2500-7aae-11dda3b5-0002a5d5c51b

     

    2- Using its path and flow name

     

    https://<hostname>:<port>/<path>/<flow>

     

    like

    https://localhost:8443/PAS/services/rest/run/Library/MyFolder/TestFlow

     

     

    If you want to pass your workflow inputs parameters (variables) you can append ?input1=value?input=value to the url and it will be like

     

    https://localhost:8443/PAS/services/rest/run/Library/MyFolder/MyFlow?name0=val0?input1=yes

     

    3- using wget

     

    4- using exe to directly launch workflows RSFlowInvoke.exe

     

    5- Using JAR file of JRSFlowInvoke

     

    RSFlowInvoke and JRSFlowInvoke are available in the OO SDK home directory, in the tools\  folder.

     

     

    Regards,
    Mahmoud Ibrahim
    http://www.mahmoudthoughts.com
  • Say thanks by clicking the "Kudos! Star" which is on the left.

  • Make it easier for other people to find solutions, by marking my answer with "Accept as Solution" if it solves your issue.
  • Frequent Advisor
    Milap
    Posts: 60
    Registered: ‎02-06-2012
    Message 7 of 21 (3,115 Views)

    Re: Call HPOO Workflow through webservice?

    Hi Ibrahim,

     

    If I use below method and make dohttp request from SM where I should pass username and password.

     

    https://localhost:8443/PAS/services/rest/run/503c2500-7aae-11dda3b5-0002a5d5c51b

     

    Warm regards,

    MIlap

     

     

    Frequent Advisor
    Milap
    Posts: 60
    Registered: ‎02-06-2012
    Message 8 of 21 (3,114 Views)

    Re: Call HPOO Workflow through webservice?

    Hi Ibrahim,

     

    If I use below method and make dohttp request from SM where I should pass username and password.

     

    https://localhost:8443/PAS/services/rest/run/503c2500-7aae-11dda3b5-0002a5d5c51b

     

    Warm regards,

    MIlap

    Honored Contributor
    Mahmoud Ibrahim
    Posts: 1,574
    Registered: ‎05-21-2008
    Message 9 of 21 (3,112 Views)

    Re: Call HPOO Workflow through webservice?

    Hi Milap,

    If you used the URL in browser it will ask you for a login, This may be useful in identifing who executes which workflows or may be needed for operators to ensure the task is completed.

     

    If you will include it in scripting langague like VB, so you can pass credentials to the browser launching function.

     

    You may use the command wget with the http-user and http-password parameters to authenticate --http-user=rsadmin --http-password=iconclude

     

    wget --http-user=rsadmin --http-password=iconclude "https://localhost:8443/PAS/services/rest/list/MyFolder/"

     

    Regards,
    Mahmoud Ibrahim
    http://www.mahmoudthoughts.com
  • Say thanks by clicking the "Kudos! Star" which is on the left.

  • Make it easier for other people to find solutions, by marking my answer with "Accept as Solution" if it solves your issue.
  • Frequent Advisor
    Milap
    Posts: 60
    Registered: ‎02-06-2012
    Message 10 of 21 (3,107 Views)

    Re: Call HPOO Workflow through webservice?

    I am trying something like this in SM javascript..

     

    It is throwing Authentication error(404 error)..

     

    var

    url ="https://uspthsphpoo01.nam.corp.gm.com:8443/PAS/services/rest/run/096e9b19-e2b2-4f20-98b5-737ea19ad46...\"admin\";password=\"admin\""

    var

    headers =newArray();

    var

    WSDLresponse =doHTTPRequest( "POST", url, headers,null,10,10,10 )

     

     

    Warm regards,

    Milap

    Frequent Advisor
    Milap
    Posts: 60
    Registered: ‎02-06-2012
    Message 11 of 21 (3,096 Views)

    Re: Call HPOO Workflow through webservice?

    Hi Ibrahim,

     

    Your will be really appreciated.help me to pass Authentication in dohttpRequest....I am getting only Authentication error...

     

    Once I get the idea of how I can pass Authentication ,It seems my issue will be resolved..

     

    Warm regards,

    MIlap Shah

    Honored Contributor
    Mahmoud Ibrahim
    Posts: 1,574
    Registered: ‎05-21-2008
    Message 12 of 21 (3,093 Views)

    Re: Call HPOO Workflow through webservice?

    The URL is wrong it should not include the username and password that's why it gives you 404
    Try the URL in the browser before use it in the script

    Another thought read about the function doHTTPrequest to know how to pass authentication

    I am currently on the go when I have a reachable system I will update you...
    Regards,
    Mahmoud Ibrahim
    http://www.mahmoudthoughts.com
  • Say thanks by clicking the "Kudos! Star" which is on the left.

  • Make it easier for other people to find solutions, by marking my answer with "Accept as Solution" if it solves your issue.
  • Frequent Advisor
    Milap
    Posts: 60
    Registered: ‎02-06-2012
    Message 13 of 21 (3,090 Views)

    Re: Call HPOO Workflow through webservice?

    Hi Ibrahim,

     

    It was just try to pass Authentication there in the Url..I am actually using below url:

     

    https://uspthsphpoo01.nam.corp.gm.com:8443/PAS/services/rest/run/096e9b19-e2b2-4f20-98b5-737ea19ad46...

     

    And yes I tried the same in browser.It was just a try to use Authentication in url..I will meanwhile check how I can pass Authentication in http request..

     

    Thanks for your reply..Please update me if you get any clue.Your help can help me resolvign this issue..

     

     

    Warm regards,

    Milap Shah

    Honored Contributor
    Mahmoud Ibrahim
    Posts: 1,574
    Registered: ‎05-21-2008
    Message 14 of 21 (3,081 Views)

    Re: Call HPOO Workflow through webservice?

    [ Edited ]

    Hi Milap,

     

    You can use msxml2.serverxmlhttp

    use create object for CreateObject("Msxml2.ServerXMLHTTP.3.0")

    use the open() method for acheiving the authentication as it uses five parameters

    open (HTTPMethode , "http://localhost/books.xml", false);

     

    oServerXMLHTTPRequest.open(bstrMethod, bstrUrl, bAsync, bstrUser, bstrPassword);

     

    bstrMethod: The HTTP method used to open the connection, such as PUT or PROPFIND. For ServerXMLHTTP, this parameter is case-sensitive and the method name must be entered in all upper-case letters.

     

    bstrUrl: The requested URL. This can be either an absolute URL, such as "http://Myserver/Mypath/Myfile.asp", or a relative URL, such as "../MyPath/MyFile.asp".

     

    bAsync(optional): Boolean. Indicator as to whether the call is asynchronous. The default is False (the call does not return immediately).

     

    bstrUser(optional): The name of the user for authentication.

     

    bstrPassword(optional): The password for authentication. This parameter is ignored if the user parameter is Null or missing.

     

    VBS Example:

    http = Server.CreateObject("MSXML2.ServerXMLHTTP")
    http.open "POST", "https://uspthsphpoo01.nam.corp.gm.com:8443/PAS/services/rest/run/096e9b19-e2b2-4f20-98b5-737ea19ad46...",   False,"username","password"
    http.send

     

     

    Ref: http://msdn.microsoft.com/en-us/library/windows/desktop/ms763809(v=vs.85).aspx

    Regards,
    Mahmoud Ibrahim
    http://www.mahmoudthoughts.com
  • Say thanks by clicking the "Kudos! Star" which is on the left.

  • Make it easier for other people to find solutions, by marking my answer with "Accept as Solution" if it solves your issue.
  • Frequent Advisor
    Milap
    Posts: 60
    Registered: ‎02-06-2012
    Message 15 of 21 (3,068 Views)

    Re: Call HPOO Workflow through webservice?

    Hi Everyone,

     

    This is for the one who is seeking this integration.Initiating HPOO FLow from SM.two things are required to achieve this.

     

    1.COnfiguring SSL between SM and OO.importing HPOO certificate in cacerts file of HPSM RUN folder with java keytool command available in HPSM help.

    2.

    A)import HPOO Wsdl in HPSM with wsdltojs and call required method.

    B)Call diretly HPOO url with doHttprequest method with below url.

     

    https://uspthsphpoo01.nam.corp.gm.com:8443/PAS/services/rest/run/096e9b19-e2b2-4f20-98b5-737ea19ad46?username="admin"&password="admin"

     

    for this you need UUID of HPOO Flow.

     

    @Ibrahim:Thanks for your great support.

     

    Please let me know if you have any questions.

     

    Warm regards,

    Milap

    Frequent Advisor
    NPearl
    Posts: 103
    Registered: ‎07-14-2008
    Message 16 of 21 (2,361 Views)

    Re: Call HPOO Workflow through webservice?

    Hi Milap,

     

    Do you have a document on the Initiating HPOO FLow from SM ??

     

    If so, can you please send across to me?

     

    Thanks,

    Nikhila

    Frequent Advisor
    Milap
    Posts: 60
    Registered: ‎02-06-2012
    Message 17 of 21 (2,357 Views)

    Re: Call HPOO Workflow through webservice?

    Hi ,

     

    Send me your email ID I can share that with you.

     

    Warm regards,

    Milap

    Frequent Advisor
    NPearl
    Posts: 103
    Registered: ‎07-14-2008
    Message 18 of 21 (2,323 Views)

    Re: Call HPOO Workflow through webservice?

    Hi Milap,

     

    I have message you my email id.

     

    Thanks.

    Frequent Advisor
    Milap
    Posts: 60
    Registered: ‎02-06-2012
    Message 19 of 21 (2,287 Views)

    Re: Call HPOO Workflow through webservice?

    Dear Pearl,

     

    I am attaching the script which will help you to call OO flow from SM.Remember this is not the web service call but the http post request.Before this call you have to setup SSL between SM and OO.You have to import OO certificate in SM cacert file available in RUN directory.

     

    My email ID:milap_ce_eng@yahoo.in

     

    Warm regards,

    Milap

    Occasional Visitor
    h3lloanand
    Posts: 1
    Registered: ‎03-06-2014
    Message 20 of 21 (1,330 Views)

    Re: Call HPOO Workflow through webservice?

    Hi,

     

    Please mail me also

     

    Email_ID : anand_p@live.in

     

    I also struggling to initiate OO Flow from SM.

     

     

    Thanks

    Anand.

    Frequent Advisor
    Milap
    Posts: 60
    Registered: ‎02-06-2012
    Message 21 of 21 (1,323 Views)

    Re: Call HPOO Workflow through webservice?

    Hi All,

     

    Please find the script which may useful to you.Please first resolve the SSL connectivity and then you can use this script.

     

    function ExecuteFlow(flowname,file)
    {
    if (flowname == "qprm")
    {
    var UUID = "e2e863c8-988e-490c-8fbc-c9360afe6b75";
    executeQPRMFlow(UUID,file);
    }
    if (flowname == "ddmiagent")
    {
    var UUID = "360a76a7-423a-420a-bbe2-1951229d7d2c";
    executeDDmiAgent(UUID,file);
    }
    }
    var url_standard = "https://<OOserver url>/PAS/services/rest/run_async/";

    function executeQPRMFlow(UUID,file)
    {
    var url = url_standard + UUID + "?username=hussain&password=milap123&";

    url += "strHostIP=" + file.oo_vc_host_ip
    + "&strVMName=" + file.oo_vm_hostname


    if(makehttpRequest(url))
    {
    file.gm_oo_flag = true;
    file.doUpdate();
    }

    }

    function executeDDmiAgent(UUID,file)
    {
    var url = url_standard + UUID + "?username=hussain&password=milap123&";
    }

    function makehttpRequest(url)
    {
    var headers = new Array();
    try{
    print(url);
    var WSDLresponse = doHTTPRequest( "POST", url, headers,10,10,10);
    print(WSDLresponse);
    return true;
    }
    catch( e )
    {
    print("There is some internal error try after sometime or provide the service manually");
    return false;
    }
    }

     

    Warm regards,

    Milap

    The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.