Calling Web Services in Request Form


So I know I have asked this before but it has been a few years and UA
has gone through a number of upgrades since then so maybe the answer has
changed too but has anyone figured out how to call a web service from a
request form and populate fields based on the results? I am
encountering more and more requests for workflows that populate one or
more fields based on results of web service calls to include data from
remote systems not in eDir. For example, one request form is for
requesting access to a target database instance. There is an external
service tracks all of the various database instances across multiple
servers and exposes this data in a web service. This means that if I
want to know all of the Oracle instances I could just call that web
service and pass Oracle as a parameter and get all of the Oracle
instances that should then be used to populate a field on the form for
the user to select. The same for MS SQL and etc.

I've been told before that this should be technically feasible but I've
never been able to find any documentation, sample code or anything that
has helped me to make it work so any help or info would be greatly
appreciated. Thanks in advance.


--
gdrtx
------------------------------------------------------------------------
gdrtx's Profile: https://forums.netiq.com/member.php?userid=1660
View this thread: https://forums.netiq.com/showthread.php?t=53008

  • Since the form runs on the client there are a few things to consider.

    If all clients have access to the web service, and you can handle authentication (or don't need to), it is possible to do this
    directly from the form. Google for jQuery and web service or jQuery ajax.

    The right way to do this (from my point of view) is to create a server page (I would go for jsp) that do the webservice call and
    then call that jsp using ajax (with jquery). Google for jsp web service client. We do this quite often and it works fine.

    Best regards,
    Tobias

    On 2015-03-06 14:24, gdrtx wrote:
    >
    > So I know I have asked this before but it has been a few years and UA
    > has gone through a number of upgrades since then so maybe the answer has
    > changed too but has anyone figured out how to call a web service from a
    > request form and populate fields based on the results? I am
    > encountering more and more requests for workflows that populate one or
    > more fields based on results of web service calls to include data from
    > remote systems not in eDir. For example, one request form is for
    > requesting access to a target database instance. There is an external
    > service tracks all of the various database instances across multiple
    > servers and exposes this data in a web service. This means that if I
    > want to know all of the Oracle instances I could just call that web
    > service and pass Oracle as a parameter and get all of the Oracle
    > instances that should then be used to populate a field on the form for
    > the user to select. The same for MS SQL and etc.
    >
    > I've been told before that this should be technically feasible but I've
    > never been able to find any documentation, sample code or anything that
    > has helped me to make it work so any help or info would be greatly
    > appreciated. Thanks in advance.
    >
    >


  • ... yes, and here's a CoolSolution to get you started

    https://www.netiq.com/communities/cool-solutions/howto-use-ajax-jquery-user-application-forms/

    Wolfgang

    On 06.03.2015 14:59, Tobias Ljunggren wrote:
    > Since the form runs on the client there are a few things to consider.
    >
    > If all clients have access to the web service, and you can handle
    > authentication (or don't need to), it is possible to do this directly
    > from the form. Google for jQuery and web service or jQuery ajax.
    >
    > The right way to do this (from my point of view) is to create a server
    > page (I would go for jsp) that do the webservice call and then call that
    > jsp using ajax (with jquery). Google for jsp web service client. We do
    > this quite often and it works fine.
    >
    > Best regards,
    > Tobias
    >
    > On 2015-03-06 14:24, gdrtx wrote:
    >>
    >> So I know I have asked this before but it has been a few years and UA
    >> has gone through a number of upgrades since then so maybe the answer has
    >> changed too but has anyone figured out how to call a web service from a
    >> request form and populate fields based on the results? I am
    >> encountering more and more requests for workflows that populate one or
    >> more fields based on results of web service calls to include data from
    >> remote systems not in eDir. For example, one request form is for
    >> requesting access to a target database instance. There is an external
    >> service tracks all of the various database instances across multiple
    >> servers and exposes this data in a web service. This means that if I
    >> want to know all of the Oracle instances I could just call that web
    >> service and pass Oracle as a parameter and get all of the Oracle
    >> instances that should then be used to populate a field on the form for
    >> the user to select. The same for MS SQL and etc.
    >>
    >> I've been told before that this should be technically feasible but I've
    >> never been able to find any documentation, sample code or anything that
    >> has helped me to make it work so any help or info would be greatly
    >> appreciated. Thanks in advance.
    >>
    >>

    >


  • We can use Integration Activity for making web service call to inside
    outside system.
    Here is the documentation link http://tinyurl.com/nc9y64q


    --
    niksahay
    ------------------------------------------------------------------------
    niksahay's Profile: https://forums.netiq.com/member.php?userid=8899
    View this thread: https://forums.netiq.com/showthread.php?t=53008


  • The root challenge with calling out to a web service from form script is
    that it runs in the browser (as opposed to the workflow script which
    runs in the Rhino based integration engine, and as a result has real
    Java objects and can make web service calls). This is not a UA
    limitation, it's really a browser feature. The feature is called SOP, or
    "Same Origin Policy", which states that a browser is not permitted to
    process data from any source other than the originating server. This is
    an "old fashioned" idea left over from the early daze on the internet
    and implemented in one of the early reference browsers (like Netscape
    2.0) which now has to be carried forwards in all of them by RFC.

    There are several ways to work around this policy, but as far as calling
    out to a web service, one approach is to write a proxy server that runs
    under the same java web server as the User App, so it has the same host
    and port, and makes the calls out for you to the destination server. I
    just dropped a jsp file into the ROOT.war. I wrote one of these to do a
    project where in a web form I needed to query a different driver,
    although I could have used it to query anything with a web service such
    as a database. Eventually I will probably publish it in a cool solution
    when I get some spare cycles. (unlike my principal architect, Geoff, who
    types so quickly that it causes time dilation, I need a break to
    write).

    The other way, which is more official, is called "CORS" or
    Cross-Origin-Resource-Sharing. As long as your browser is modern there
    isn't any reason you couldn't support this with a web service you
    create; in my case I was using an existing web service that I could not
    modify, so I had to build the proxy.

    This article which, to verbify, I "Googled", has some discussion of this
    and other options:
    http://tinyurl.com/qd8kwew


    --
    rrawson
    ------------------------------------------------------------------------
    rrawson's Profile: https://forums.netiq.com/member.php?userid=403
    View this thread: https://forums.netiq.com/showthread.php?t=53008