IT Process Automation

 View Only
  • 1.  Is it possible to call XMLHttpRequest() from a javascript operator?

    Posted Aug 24, 2015 02:36 PM

    With the HTTP Post operator I'm forced to use a file for input since the text box is too short to include all of the data I want.

     

    Instead, I would like to make a REST call directly from javascript.

     

    Is it possible to call XMLHttpRequest() from a javascript operator?

     

    I'm getting:

    -- ReferenceError: "XMLHttpRequest" is not defined. (#14)

     

    Regards,

     

    Rick



  • 2.  Re: Is it possible to call XMLHttpRequest() from a javascript operator?

    Broadcom Employee
    Posted Aug 31, 2015 09:49 AM

    I'm not aware of a way to make a REST call from javascript within PAM.  The PAM javascript operator understands a subset of javascript commands so my guess is XMLHttpRequest is not one that PAM understands.

     

    Can you assign your text to a variable and then use that variable in the text box within the HTTP Post operator?



  • 3.  Re: Is it possible to call XMLHttpRequest() from a javascript operator?

    Posted Aug 10, 2018 04:46 PM

    I'm new to CA products and have been wondering about this very question.  It sort of makes sense that from within PAM operators we cannot make http requests - but what about from within the script field of the form designer in service catalog?  Anyone have success doing that?  Andy_Thompson rwill



  • 4.  Re: Is it possible to call XMLHttpRequest() from a javascript operator?

    Broadcom Employee
    Posted Aug 10, 2018 05:31 PM

    Hi Michael,

     

    I know the products are integrated but unfortunately I don't have much knowledge on Service Catalog's form designer.  I would encourage you to launch a new thread in the Service Catalog community.



  • 5.  Re: Is it possible to call XMLHttpRequest() from a javascript operator?

    Posted Aug 10, 2018 05:34 PM

    Good suggestion.  Thank you Andrew.



  • 6.  Re: Is it possible to call XMLHttpRequest() from a javascript operator?

    Posted Aug 10, 2018 10:04 PM

    This is possibly in service catalog. I’ve shared an example here.

    Select Box in Catalog invoke REST or Curl 



  • 7.  Re: Is it possible to call XMLHttpRequest() from a javascript operator?

    Posted Sep 25, 2018 02:19 PM

    Yes you can. I did a couple of ajax call from within a form to verify that someone has a specific AD attribute.



  • 8.  Re: Is it possible to call XMLHttpRequest() from a javascript operator?

    Posted Aug 16, 2018 10:14 AM

    Hi,

     

    Just curious what you meant by the text box is too short?  Are you trying to enter a lot of data into the actual box on the operator?

    One of the ways I populate large amounts of data is to store it in an operator variable (usually in the pre-exec code) and then pass that into the operator with (example) Process[OpName].RestBody

     

    Also, I often use PowerShell to run my Http/Rest requests, as you can easily make those calls there.

     

    Not sure if this helps you with your issue, but thought I'd mention it.

     

    Ian