API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  testing APIC apis and sending dummy test data based on the schema

    Posted Wed January 24, 2024 05:20 PM

    Hello Team,

    I'm in the process of conducting a POC to explore how APIC can provide/return default data. I'm exploring a couple of methods:

    1. Utilizing message templates, although it appears that this feature is not available in version 10.x.
    2. Implementing XSLT policy.

    I am currently using XSLT and attempting to comprehend how to incorporate an IF condition, such as:

    ($httpVerb() = 'GET') and headers.X-ibm-client-name

     
    This condition should trigger the execution of the XSLT. I'm uncertain about how to retrieve the IBM client name.

    Additionally, I'm investigating if there's a way to retrieve a sample response already available on the developer portal.

    Any suggestions would be greatly appreciated.

    Thank you,

    Imtiyaz



    ------------------------------
    Syed Imtiyaz Alam
    ------------------------------


  • 2.  RE: testing APIC apis and sending dummy test data based on the schema

    Posted Thu January 25, 2024 04:14 AM

    Hi, 

    The message template policy is available for v10 - it's a custom user defined policy that can be downloaded and imported to your deployment (or we pre-deploy it in the SaaS case). You can get the policy from the list at the bottom of this page - https://www.ibm.com/support/pages/node/6991789

    Thanks

    Ricky



    ------------------------------
    Ricky Moorhouse
    IBM API Connect Cloud Architect
    ------------------------------



  • 3.  RE: testing APIC apis and sending dummy test data based on the schema

    Posted Mon January 29, 2024 10:25 PM

    thank you and exploring this option now.



    ------------------------------
    Syed Imtiyaz Alam
    ------------------------------



  • 4.  RE: testing APIC apis and sending dummy test data based on the schema

    Posted Fri January 26, 2024 03:39 AM

    Did you explore this article https://www.ibm.com/products/api-connect/api-testing ?

    XSLT supports if and choose https://www.w3schools.com/xml/xsl_if.asp

    But I doubt your team appreciates the effort you spend in writing a XSLT file for testing APIC.



    ------------------------------
    Matthias Jungbauer
    ------------------------------



  • 5.  RE: testing APIC apis and sending dummy test data based on the schema

    Posted Mon January 29, 2024 10:35 PM

    I have not but will explore that also. Thank you for providing this info.

    Right now I am exploring this message-template which provides the mock data.

    and I am trying to see when this mock data is returned. My current use case is using Switch and setting up the condition 

    ($httpVerb() = 'GET' and $header("X-IBM-Client-Id") = 12345678)

    but instead of using the X-IBM-Client-Id, I need to the use name(X-IBM-Client-name) so not sure if name can be available during execution ?

    Any suggestions.



    ------------------------------
    Syed Imtiyaz Alam
    ------------------------------