Make Java calls from SOAP driver


Is it possible to use java to write three text files after retrieving
information from a SOAP response?Is there a way to do this in the SOAP
driver or there is a other way to do this?Can anybody post a sample code
for the same?


--
joydeepg
------------------------------------------------------------------------
joydeepg's Profile: https://forums.netiq.com/member.php?userid=7638
View this thread: https://forums.netiq.com/showthread.php?t=53439

  • On 5/6/2015 10:44 AM, joydeepg wrote:
    >
    > Is it possible to use java to write three text files after retrieving
    > information from a SOAP response?Is there a way to do this in the SOAP
    > driver or there is a other way to do this?Can anybody post a sample code
    > for the same?


    Link the LibAJC EMCA policy. (Part of almost every driver in IDM 4.x,
    and available as of IDM 3.6). There is a Common, ECMA Script package
    that includes it.

    There is either a writeTofIle() or appendToLog() function in there for
    writing out to files.

    So you need a file name ($FILE variable, say), a message ($MESSAGE
    variable, say).

    Then you would set local variable DUMMY to XPATH
    es:writeToFile($FILE,$MESSAGE) or whatever the actual real function is.

    Works fine.


  • Geoffrey Carman <geoffreycarmanNOSPAM@NOSPAMgmail.com> wrote:
    > On 5/6/2015 10:44 AM, joydeepg wrote:
    >>
    >> Is it possible to use java to write three text files after retrieving
    >> information from a SOAP response?Is there a way to do this in the SOAP
    >> driver or there is a other way to do this?Can anybody post a sample code
    >> for the same?

    >
    > Link the LibAJC EMCA policy. (Part of almost every driver in IDM 4.x,
    > and available as of IDM 3.6). There is a Common, ECMA Script package that includes it.
    >
    > There is either a writeTofIle() or appendToLog() function in there for
    > writing out to files.


    Keep in mind that these ECMAScript functions are not thread safe so:

    Try to only write to each specific file from a single policy in a driver.
    That way you avoid scenarios where two threads try and update the same file
    at the same time (publisher and subscriber channels are separate threads)


    --
    If you find this post helpful and are logged into the web interface, show
    your appreciation and click on the star below...
  • On Wed, 06 May 2015 14:44:01 0000, joydeepg wrote:

    > Is it possible to use java to write three text files after retrieving
    > information from a SOAP response?


    Yes. You can do that with xpath. You're better off with ECMAscript,
    though.


    --
    --------------------------------------------------------------------------
    David Gersic dgersic_@_niu.edu
    Knowledge Partner http://forums.microfocus.com

    Please post questions in the forums. No support provided via email.
    If you find this post helpful, please click on the star below.

  • Hi,

    I'm new to ECMA, I was trying to write a modify event for an attribute
    to a file. Could you please show me a sample code on how to write the
    modify events of an attribute from log to a file?


    Thanks,
    Agnel


    --
    Agnel_Vincent
    ------------------------------------------------------------------------
    Agnel_Vincent's Profile: https://forums.netiq.com/member.php?userid=8450
    View this thread: https://forums.netiq.com/showthread.php?t=53439

  • On 5/8/2015 2:24 AM, Agnel Vincent wrote:
    >
    > Hi,
    >
    > I'm new to ECMA, I was trying to write a modify event for an attribute
    > to a file. Could you please show me a sample code on how to write the
    > modify events of an attribute from log to a file?


    At the driverset level, add the Package from the catalog:
    Common
    ECMASCript
    Advanced Java Class


    Now this library is available in the tree. IN your driver,
    Configuration side tab in Designer, then ECMA top tab, add it to link it
    in, by browsing to the Driverset, then Library, then NOVLLIBAJC-JS object.

    Then in a policy where you wish to write to a file:

    Get your filename into a variable lv-FILE
    Get your message to append built and stored in a variable lv-MESSAGE

    Then use this one token:

    <do-set-local-variable name="DOESNT-MATTER" scope="policy">
    <arg-string>
    <token-xpath expression="es:writeLog($lv-FILE,$lv-MESSAGE)"/>
    </arg-string>
    </do-set-local-variable>

    Key is, you are not the one writing the ECMA function. You are just
    calling a pre-written one in IDM. Much simpler.