none
Logic App issue "UnsupportedMediaType. RRS feed

  • Question

  • Hi Folks,

    I am trying to build application with LogicApp and BizTalk .

    This is my  xml message 

    <ns0:CustomerReq xmlns:ns0="http://GetCustomerDetails.CustomerReq">

      <ID></ID>
    </ns0:CustomerReq>

    this is my Json shcema

    {
      "$schema": "http://json-schema.org/draft-04/schema Jump #",
      "type": "object",
      "properties": {
        "ns0:CustomerReq": {
          "type": "object",
          "properties": {
            "-xmlns:ns0": {
              "type": "string"
            },
            "ID": {
              "type": "string"
            }
          },
          "required": [
            "-xmlns:ns0",
            "ID"
          ]
        }
      },
      "required": [
        "ns0:CustomerRecord"
      ]
    }


    When I am trying to make a call wth this test message

    {
      "ns0:CustomerReq": {
        "-xmlns:ns0":"xmlns:ns0="http://GetCustomerDetails.CustomerReq",
        "ID": "A001"
      }
    }

    I am getting error "UnsupportedMediaType.

    Thursday, May 24, 2018 3:21 PM

Answers

  • Hi Chandan,

    Below is the workflow definition for the logic apps with parse action .

    {
        "definition": {
            "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
            "actions": {
                "Parse_JSON": {
                    "inputs": {
                        "content": "@json(triggerBody())",
                        "schema": {
                            "properties": {
                                "ns0:CustomerReq": {
                                    "properties": {
                                        "@@xmlns:ns0": {
                                            "type": "string"
                                        },
                                        "ID": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "runAfter": {},
                    "type": "ParseJson"
                },
                "Response": {
                    "inputs": {
                        "body": "@body('Parse_JSON')?['ns0:CustomerReq']?['ID']",
                        "statusCode": 200
                    },
                    "runAfter": {
                        "Parse_JSON": [
                            "Succeeded"
                        ]
                    },
                    "type": "Response"
                }
            },
            "contentVersion": "1.0.0.0",
            "outputs": {},
            "parameters": {},
            "triggers": {
                "request": {
                    "inputs": {
                        "schema": {}
                    },
                    "kind": "Http",
                    "type": "Request"
                }
            }
        }
    }

    Request payload

    <ns0:CustomerReq xmlns:ns0="http://GetCustomerDetails.CustomerReq">
      <ID>1234</ID>
    </ns0:CustomerReq>

    Content-Type:application/xml

    regards

    Abhishek

     

    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply


    Tuesday, May 29, 2018 1:58 AM

All replies

  • Hi CHnadra,

    I think you are sending from Logic App to BizTalk. Is it happening at your Logic App first Stage itself? Can you show the Designer view where you are getting the Error?


    Sujith

    Thursday, May 24, 2018 4:55 PM
  • Thursday, May 24, 2018 5:02 PM
  • Hi Chandra,

    i think if you see the Screen shot i can see in the Inputs COntent Type is different its not     "Content-Type": "application/json"

    Can you give the Json and Try again?

    Thanks,

    Sujith.


    Sujith

    Thursday, May 24, 2018 6:33 PM
  • Hi Chandan,

    Below is the workflow definition for the logic apps with parse action .

    {
        "definition": {
            "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
            "actions": {
                "Parse_JSON": {
                    "inputs": {
                        "content": "@json(triggerBody())",
                        "schema": {
                            "properties": {
                                "ns0:CustomerReq": {
                                    "properties": {
                                        "@@xmlns:ns0": {
                                            "type": "string"
                                        },
                                        "ID": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "runAfter": {},
                    "type": "ParseJson"
                },
                "Response": {
                    "inputs": {
                        "body": "@body('Parse_JSON')?['ns0:CustomerReq']?['ID']",
                        "statusCode": 200
                    },
                    "runAfter": {
                        "Parse_JSON": [
                            "Succeeded"
                        ]
                    },
                    "type": "Response"
                }
            },
            "contentVersion": "1.0.0.0",
            "outputs": {},
            "parameters": {},
            "triggers": {
                "request": {
                    "inputs": {
                        "schema": {}
                    },
                    "kind": "Http",
                    "type": "Request"
                }
            }
        }
    }

    Request payload

    <ns0:CustomerReq xmlns:ns0="http://GetCustomerDetails.CustomerReq">
      <ID>1234</ID>
    </ns0:CustomerReq>

    Content-Type:application/xml

    regards

    Abhishek

     

    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply


    Tuesday, May 29, 2018 1:58 AM