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

Parents

  • 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

Reply

  • 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

Children
No Data