DataPower

DataPower

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.  Schema validation

    Posted 03/09/21 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 03/10/21 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 03/12/21 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 03/12/21 09:21 AM

    Hello,

    Thanks for your reply. I will try with GatewayScript.



    #DataPower
    #Support
    #SupportMigration


  • 5.  RE: Schema validation

    Posted 03/12/21 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