DataPower

 View Only
  • 1.  Schema validation

    Posted Tue March 09, 2021 04:34 PM

    Hello,

    A request has json payload. In the json there is a field which has xml data encoded with base64. What is the good way to validate the xml data with the xml schema after base64 decoding in Multiple Protocol Gateway .

    example payload:

    {

    "Mainpaylod": {

    "field1": "field1-value",

    "field2" : "field2-value",

    "SecPayload": {

    "xmlbase64": "base64xmlmessage"

    }

    }

    }

    Thanks



    #DataPower
    #Support
    #SupportMigration


  • 2.  RE: Schema validation

    Posted Wed March 10, 2021 10:20 AM

    Hi,

    maybe a trivial answer but I would use the schema validate action. Perhaps extract and decode the XML with GatewayScript and then validate action.

    --HP



    #DataPower
    #Support
    #SupportMigration


  • 3.  RE: Schema validation

    Posted Fri March 12, 2021 08:03 AM

    Alternatively call XSLT with transform.XSLT() and in stylesheet use "dp:schema-validate()":

    "https://www.ibm.com/support/knowledgecenter/SS9H2Y_7.7.0/com.ibm.dp.doc/schema-validate_metadatafunction.html



    #DataPower
    #Support
    #SupportMigration


  • 4.  RE: Schema validation

    Posted Fri March 12, 2021 09:21 AM

    Hello,

    Thanks for your reply. I will try with GatewayScript.



    #DataPower
    #Support
    #SupportMigration


  • 5.  RE: Schema validation

    Posted Fri March 12, 2021 12:08 PM

    Here is a non-trivial example showing how to execute dynamic XSLT from GatewayScript. Replace dp:xquery-transform() with dp:schema-validate():

    https://stamm-wilbrandt.de/en/blog/3lang.js



    #DataPower
    #Support
    #SupportMigration