Decision Management (ODM,ADS)

 View Only
  • 1.  ODM API conversion from SOAP to REST

    Posted Tue November 21, 2023 05:58 PM

    Hi all, I am currently in the process of converting some SOAP API calls to REST APIs in ODM. Has anyone been through this process please and what steps do I need to take? Is there a guide somewhere on how to do this please? 



    ------------------------------
    David Afolabi
    ------------------------------



  • 2.  RE: ODM API conversion from SOAP to REST

    Posted Tue November 21, 2023 06:41 PM

    Which part is bothering you, is it the parameters or the invocation?  In what application are you integrating your calls?

    You can get a good idea of how to make the call using the test tool accessible in the action "Retrieve HTDS description file". 

    See details here: https://www.ibm.com/docs/en/odm/8.11.1?topic=rulesets-testing-ruleset-rest-execution

    To make the call in java there is a sample here: https://www.ibm.com/docs/en/odm/8.11.1?topic=8111-calling-decision-services-rest-api and more details here  https://www.ibm.com/docs/en/odm/8.11.1?topic=applications-executing-rules-by-using-rest-service



    ------------------------------
    Alain Robert
    ------------------------------



  • 3.  RE: ODM API conversion from SOAP to REST

    Posted Wed November 22, 2023 03:16 AM

    Thank you Alain.

    So our ODM platform is integrated with IBM BPM which controls the user interface. So we make API calls from ODM to BPM. I just need to know what parameters needs changing and how to convert to xml response to Json.



    ------------------------------
    David Afolabi
    ------------------------------



  • 4.  RE: ODM API conversion from SOAP to REST

    Posted Wed November 22, 2023 03:42 PM

    You can use the WADL format and continue with XML, this will require minimal changes.  If you decide to go with the OpenAPI - JSON format then check in the RES Console to generate the descriptor that shows the  input expected. 

    Note that you can test the input format both XML and JSON with the test button. 



    ------------------------------
    Alain Robert
    ------------------------------



  • 5.  RE: ODM API conversion from SOAP to REST

    Posted Wed November 22, 2023 06:12 PM

    Thanks for the swift response Alain



    ------------------------------
    David Afolabi
    ------------------------------



  • 6.  RE: ODM API conversion from SOAP to REST

    Posted Wed January 03, 2024 04:20 PM
    Edited by David Afolabi Mon January 08, 2024 02:16 AM

    Hi Alain, sorry to brother you again but I am still a bit stuck on this work. 
    we use ODM on cloud and Rule designer.
    So basically, I realised that our system currently use XML binding, I was told that I will need to move from XML binding to Java XOM. 
    I am still a bit confused as to how this transformation works because I couldn't find any resources online to guide me. 

    Is there a way to do this please?



    ------------------------------
    David Afolabi
    ------------------------------



  • 7.  RE: ODM API conversion from SOAP to REST

    Posted Mon January 08, 2024 04:31 PM

    Hi,

    There is no direct way to remove XML Binding,  The recommendation is to use JAXB to generate XOM classes from the XML schema and  then generate a BOM from this new java XOM. See   https://docs.oracle.com/javase/8/docs/technotes/tools/unix/xjc.html

    Control the package output so that it matches the current path of the classes in the BOM.

    The expectation is that this new BOM should be fairly close to the current BOM you are using so that the impact on the rules is minimal.  

    To reduce the impact further instead of generating a new BOM you can change the B2X mapping of the classes in the existingBOM with the one generated and add  B2X implementation if needed.  replace all references to IlrXMLObject with the generated classes.



    ------------------------------
    Alain Robert
    ------------------------------



  • 8.  RE: ODM API conversion from SOAP to REST

    Posted Tue January 09, 2024 05:07 AM

    Thank you Alain, I'll look into this as well.

    Thanks a lot



    ------------------------------
    David Afolabi
    ------------------------------



  • 9.  RE: ODM API conversion from SOAP to REST

    Posted Tue January 09, 2024 05:42 AM

    You can also use the jaxb2-maven-plugin Maven plugin "to process all XSD files found within the schema directory, and create Java source code in the given package."

    https://www.mojohaus.org/jaxb2-maven-plugin/Documentation/v2.2/example_xjc_basic.html

    Peter



    ------------------------------
    Peter Warde
    peterwarde@rulearchitect.com
    ------------------------------