InfoSphere Optim

 View Only
  • 1.  Cannot consume Optim Service Interface (OSI RESTful Services)

    Posted Tue January 31, 2023 12:53 PM
    Howdy!

    We are looking for help, We are installing Optim 11.7 in Windows, and everything seems to work fine, until we try to deploy the OSI RESTful Services to the Liberty Application server, we are doing the steps of the following documentation:

    Deploying the service interface WAR file on IBM WebSphere Liberty


    After that, we try to consume it, with the the URL that is defined in the documentation methods Get Optim Directory Connections method:

    http://localhost:9080/server/connection

    But the service returned "Not Implemented", ¿are we missing something?

    If we try the other endpoints, like /monitor it returns a 404 not found, and if we try the root /server it redirects to /server/admin and returns "proxyservlet /admin". 

    The curios thing is that if we try the command line utility for the service interface mentioned here Command-line utility for service interface, all the commands work properly and we can get the connections, servicesID, of our environment. 

    We would like to use the OSI Restful API to automate some jobs, we looked the documentation searching for a "missing step", has someone faced something similar?

    Thanks in advance.


    ------------------------------
    Cesar Tocon
    ------------------------------


  • 2.  RE: Cannot consume Optim Service Interface (OSI RESTful Services)

    Posted Tue January 31, 2023 06:38 PM
    Cesar,

    If none of the REST API services are working, that would be an indication the Optim Services Interface WAR file has not been deployed.

    In 11.7, WebSphere Liberty is the application server and the OSI needs to be deployed to the base OptimWebServer/apps directory/folder.  Then the server.xml file will need to have the entry to open/call the OSI.

    --

    Jimmy Wilson


    1999 S. Bascom Ste 700

    Campbell, CA 95008

    Phone +1(972) 567-5558

    jwilson@abmartin.com

     

    Unstructured Data Masking

    Data Privacy/Test data Management - fabrication, optimization, obfuscation






  • 3.  RE: Cannot consume Optim Service Interface (OSI RESTful Services)

    Posted Wed February 01, 2023 01:28 PM
    Hi Jimmy,

    Thank you!, the war File was deployed, we found out that if you try to consume the endpoints from any browser (we tried, Chrome, Firefox, Internet Explorer), for example GET  http://localhost:9080/server/connection, it returns "Not Implemented", but when consuming it with PostMan, it returns the XML with the conenctions. I have no clue why with browsers it won't work.

    Now we are facing another problem when trying to run the job service, with:

    HTTP method: POST

    URI: /execute/connection_name/service_id

    But it returns a 404 not found, the service_id does exists because it can execute the service via the command utility. 

    If I have any updates I will post it here.

    Thanks again, regards.

    ------------------------------
    Cesar Tocon
    ------------------------------



  • 4.  RE: Cannot consume Optim Service Interface (OSI RESTful Services)

    Posted Wed February 01, 2023 04:34 PM

    Cesar,


    Yes the OSI API's can't be used from a browser. The API's return XML data which the browser can't handle and shows Not Implemented. The only way to use these API's is to use REST Client (I use POSTMAN for chrome which is deprecated now but chrome has another REST Client now, For Firefox I have mozilla's REST Client) or write your own python or java program. Probably you could use other languages as well but I have only used these two.


    As an example of the post execution for 11.7:


    HTTP Method:  POST

    XML Body:
    <?xml version="1.0" encoding="UTF-8"?>
    <sem:serviceRequestExecutionInput  
       xmlns:sem="http://www.ibm.com/optim/xsd/sem/9.1.0"  
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
       xsi:schemaLocation="http://www.ibm.com/optim/xsd/sem/9.1.0/resource.xsd " >
       <rsiURL>https://192.168.1.26:12443/</rsiURL>
       <executedBy>optim</executedBy>
       </sem:serviceRequestExecutionInput>

    Response:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ns2:executionResults xmlns:ns2="http://www.ibm.com/optim/xsd/sem/9.1.0">
        <executionId>13bc00df-a977-4708-b399-5409fd464db9</executionId>
        <requestType>com.ibm.nex.model.oim.distributed.ExtractRequest</requestType>
        <origin>WEB_SERVICES_BRIDGE</origin>
        <returnCode>0</returnCode>

    I hope that helps.
    --

    Jimmy Wilson


    1999 S. Bascom Ste 700

    Campbell, CA 95008

    Phone +1(972) 567-5558

    jwilson@abmartin.com

     

    Unstructured Data Masking

    Data Privacy/Test data Management - fabrication, optimization, obfuscation