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.  xpath expresson on switch policy not woring

    Posted Fri July 21, 2023 11:25 AM
    Edited by santhoshkumar surisetty Fri July 21, 2023 11:30 AM

    Hi , 

    xpath function on switch policy is not working , Could you please help on it. please guide me on syntax if it is wrong .i used two syntaxes.

    ($xpath(message.body, "//*[local-name()='heading']= 'Reminder'") )

    ($xpath(request.parsed_body, "//*[local-name()='heading']= 'Reminder'") ) 



    ------------------------------
    santhoshkumar surisetty
    ------------------------------



  • 2.  RE: xpath expresson on switch policy not woring

    Posted Sat July 22, 2023 01:34 PM

    Hi Santhoshkumar,

    the expression for the switch policy is JSONata with the $xpath function on the left side and your string literal on the right side of the equal operator. You gave the string literal of the JSONata as part of the XPath.  Please try:

    ($xpath(message.body, "//*[local-name()='heading']")= 'Reminder')

    Best Regards,

    Steve Linn



    ------------------------------
    Steve Linn
    Senior Consulting I/T Specialist
    IBM
    ------------------------------



  • 3.  RE: xpath expresson on switch policy not woring

    Posted Sat July 22, 2023 10:47 PM

    i tried same syntax before but  it won't let me to publish and getting error



    ------------------------------
    santhoshkumar surisetty
    ------------------------------



  • 4.  RE: xpath expresson on switch policy not woring

    Posted Mon July 24, 2023 07:20 AM

    Hi Santhoshkumar,
    What firmware version are you using?  This error is a product defect that has been fixed in the current release. 

    Best Regards,

    Steve Linn



    ------------------------------
    Steve Linn
    Senior Consulting I/T Specialist
    IBM
    ------------------------------



  • 5.  RE: xpath expresson on switch policy not woring

    Posted Mon July 24, 2023 09:12 AM
    Edited by System Admin Thu July 27, 2023 03:58 PM

    we are using 10.5.0.4 . could you please tell me in which version it was fixed.

    ------------------------------
    santhoshkumar surisetty
    ------------------------------



  • 6.  RE: xpath expresson on switch policy not woring

    Posted Mon July 24, 2023 09:30 AM
    Edited by System Admin Thu July 27, 2023 04:03 PM

    we are using 10.5.0.4 . could you please let me know in which version the issue is fixed.


    ------------------------------
    santhoshkumar surisetty
    ------------------------------



  • 7.  RE: xpath expresson on switch policy not woring

    Posted Mon July 24, 2023 05:31 PM
    Edited by System Admin Thu July 27, 2023 04:04 PM

    Hi Santhoshkumar,
    Not sure why your above two posts appear empty, although at one time I thought I saw you posted a version but it isn't visible now?  Anyway, I was told this was fixed in API Manager 10.0.5.3.  I asked above what was your DataPower firmware version,  but the correct question for the publish issue is what is your API Connect version?
    Best Regards, 
    Steve


    ------------------------------
    Steve Linn
    Senior Consulting I/T Specialist
    IBM
    ------------------------------



  • 8.  RE: xpath expresson on switch policy not woring

    Posted Tue July 25, 2023 09:45 AM
    Edited by System Admin Thu July 27, 2023 04:05 PM

    Our API manager version is 10.0.5.3-4934



    ------------------------------
    santhoshkumar surisetty
    ------------------------------



  • 9.  RE: xpath expresson on switch policy not woring

    Posted Mon August 14, 2023 06:27 AM

    Hi Santosh,

    You can add the below to avoid the issue.

    x-ibm-configuration:
      compatibility:
        suppress-limitation-errors: true


    ------------------------------
    Ravikumar Kunibilli
    ------------------------------