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.


#API Connect
#Applicationintegration
#APIConnect
 View Only
Expand all | Collapse all

Issue with Validating the XML payload using XSD in APIC v10

  • 1.  Issue with Validating the XML payload using XSD in APIC v10

    Posted Fri December 23, 2022 12:24 AM
    Edited by Stefen Salvatore Tue June 20, 2023 08:31 AM
      |   view attached

    Hi Everyone,

    I am facing some issues in validating xml request in APIC v10 For your information a word document is attached here. I've wrote an XSD for my xml request and it is working fine in DataPower and V5. 
    Fine!!
    And I am validating JSON request also and its YAML is working fine and is attached below. Please check both and let me know where I am going wrong and guide me succeeding this.
    But i need to validate XML in my V10 Environment and it is throwing the following errors:

    In one case it is throwing:
    <?xml version="1.0" encoding="UTF-8"?> <errorResponse> <httpCode>500</httpCode> <httpMessage>Internal Server Error</httpMessage> <moreInformation>Validate: Failed to execute the schema</moreInformation> </errorResponse>

    In another case it is throwing:
    <?xml version="1.0" encoding="UTF-8"?> <errorResponse> <httpCode>500</httpCode> <httpMessage>Internal Server Error</httpMessage> <moreInformation>Validate: schema property is empty</moreInformation> </errorResponse>


    Note: Please go through the document attached below.

    *** And one more thing is we unable to add the revocation url for Oauth and So that token is not generating And Throwing 404 No Resource Match For Request URI.

    Thanks in Advance!!


    ------------------------------
    Stefen Salvatore

    ------------------------------

    Attachment(s)

    docx
    Validations.docx   179 KB 1 version


  • 2.  RE: Issue with Validating the XML payload using XSD in APIC v10

    Posted Tue December 27, 2022 01:52 PM
    Hi Vyasavardhan,
    That error message is indicative of not being able to get the schema. Are there any related log messages in the DataPower logs to indicate why the xsd can't be found? In v10 the actual xsd is stored in the yaml base-64 encoded which is different from v5 that generated a xsd from the yaml definition for every request. There was a defect in the v10 UI (not sure when that was fixed) that would generate the base-64 encoded property with the wrong encoding, utf-8LE as I recall, and at runtime the decode would fail as it was expecting utf-8. I'm not sure if that is what you're experiencing without seeing the yaml. What v10 version are you using?  You may take the base-64 property value for your definition and run it through an online decoder to see if that is what the issue is. If so you should be able to decode it with utf-8LE and then re-encode with utf-8 and replace the property value in your yaml.

    Best Regards,
    Steve Linn

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



  • 3.  RE: Issue with Validating the XML payload using XSD in APIC v10

    Posted Tue June 20, 2023 08:31 AM
    Edited by Stefen Salvatore Tue June 20, 2023 08:46 AM
      |   view attached

    Hi @Steve Linn 

    Attachment(s)



  • 4.  RE: Issue with Validating the XML payload using XSD in APIC v10

    Posted Tue June 20, 2023 08:42 AM
    Edited by Stefen Salvatore Wed June 21, 2023 01:17 AM

    Hi @Steve Linn 

    Hope you are doing well.
    I am trying to implement SOAP Message Validation in API Connect. And no WSDLs are used in the implementation.
    I am getting errors like "schema property is empty".
    Logs in datapower are given below:

    5:10:24 PM 2098353 request 192.18.X.238 0x88c00023 apigw (Api-Dev): Assembly rule 'framework_b-framework_collection-assembly-rule-global' is interrupted: Invalid property..
    5:10:24 PM 2098353 request 192.18.X.238 0x80c00009 apigw (Api-Dev): request framework_b-framework_collection-assembly-rule-global #3 assembly-function-call (default-func-call-main): Performed function call assembly action. failed: Invalid property.
    5:10:24 PM 2098353 request 192.18.X.238 0x88c00023 apigw (Api-Dev): Assembly rule 'default-assembly-rule-main' is interrupted: Invalid property..
    5:10:24 PM 2098353 request 192.18.X.238 0x80c00009 apigw (Api-Dev): request default-assembly-rule-main #1 api-execute: Performed the API execute action. failed: Invalid property.
    5:10:24 PM 2098353 request 192.18.X.238 0x88c00023 apigw (Api-Dev): Assembly rule 'framework_bXX-framework_schemavalidation-xml-json-blog-api_1.0.0_rule_0' is interrupted: Invalid property..
    5:10:24 PM 2098353 request 192.18.X.238 0x80c00009 apigw (Api-Dev): request framework_b-framework_schemavalidation-xml-json-blog-api_1.0.0_rule_0 #2 assembly-validate (framework_bob-framework_schemavalidation-xml-json-blog-api_1.0.0_validate_8): Performed the assembly validate action. failed: Invalid property.
    5:10:24 PM 2098353 request 192.18.X.238 0x88c00188 apigw (Api-Dev): The assembly Validate action instance is XML but the specified schema object does not handle this type of input.

    I don't know where I am going wrong.
    Sample schema and Soap message are attached in below  Files along with the yaml of API in it. please go through it and guide me to achieve my requirement implementation.



    Thanks in Advance!!



    ------------------------------
    Stefen Salvatore
    ------------------------------



    Attachment(s)

    json
    Schema.json   1 KB 1 version
    yaml
    Val.yaml   11 KB 1 version