Azure Logic app Json to XML conversion-fialing the XML when validating against with schema

Amar-Azure-Practice 656 Reputation points
2020-09-20T01:25:17.84+00:00

Hi

I have logic app i have converted Json message to XML using xml(triggerBody())

I see message Json got converted to XML but it did not get the namespace to message.

when i am validating the XML message against the schema it failing.

Error: 'Could not find schema information for the element'25807-capture.jpg

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,707 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JayaC-MSFT 5,511 Reputation points
    2020-09-26T13:52:43.337+00:00

    @Amar-Azure-Practice I haven't heard from you. Please validate the xsd file and the payload details. For reference, I am sharing the content with which I have tested:

    xsd:

    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">  
      <xs:element name="ResultSets">  
        <xs:complexType>  
          <xs:sequence>  
            <xs:element name="ResultSets">  
              <xs:complexType>  
                <xs:sequence>  
                  <xs:element name="Table1" maxOccurs="unbounded" minOccurs="0">  
                    <xs:complexType>  
                      <xs:sequence>  
                        <xs:element type="xs:short" name="ProductID"/>  
                        <xs:element type="xs:string" name="Name"/>  
                        <xs:element type="xs:string" name="ProductNumber"/>  
                        <xs:element type="xs:string" name="Color"/>  
                        <xs:element type="xs:float" name="StandardCost"/>  
                        <xs:element type="xs:float" name="ListPrice"/>  
                        <xs:element type="xs:byte" name="Size"/>  
                        <xs:element type="xs:float" name="Weight"/>  
                      </xs:sequence>  
                    </xs:complexType>  
                  </xs:element>  
                </xs:sequence>  
              </xs:complexType>  
            </xs:element>  
          </xs:sequence>  
        </xs:complexType>  
      </xs:element>  
    </xs:schema>  
    

    Sample payload :

    {  
    "ResultSets": {  
    "Table1": [  
          {  
            "ProductID": 680,  
            "Name": "HL Road Frame - Black, 58",  
            "ProductNumber": "FR-R92B-58",  
            "Color": "Black",  
            "StandardCost": 1059.31,  
            "ListPrice": 1431.5,  
            "Size": "58",  
            "Weight": 1016.04  
          },  
          {  
            "ProductID": 706,  
            "Name": "HL Road Frame - Red, 58",  
            "ProductNumber": "FR-R92R-58",  
            "Color": "Red",  
            "StandardCost": 1059.31,  
            "ListPrice": 1431.5,  
            "Size": "58",  
            "Weight": 1016.04  
          }]  
     }  
    }  
    

    logic app code :

    {  
        "definition": {  
            "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",  
            "actions": {  
                "XML_Validation": {  
                    "inputs": {  
                        "content": "@xml(json(concat('{\"ResultSets\":',triggerBody(),'}')))",  
                        "integrationAccount": {  
                            "schema": {  
                                "name": "testSchema"  
                            }  
                        }  
                    },  
                    "runAfter": {},  
                    "type": "XmlValidation"  
                }  
            },  
            "contentVersion": "1.0.0.0",  
            "outputs": {},  
            "parameters": {},  
            "triggers": {  
                "manual": {  
                    "inputs": {  
                        "schema": {}  
                    },  
                    "kind": "Http",  
                    "type": "Request"  
                }  
            }  
        },  
        "parameters": {}  
    }  
    

    Please let me know if it helps. If yes, please "accept the answer" and "up-vote" it so that it helps others in the community.

    0 comments No comments