Azure / logicapps

Azure Logic Apps labs, samples, and tools
MIT License
368 stars 302 forks source link

Issue with managed EDIFACT connector #1242

Open flacidsnake opened 2 days ago

flacidsnake commented 2 days ago

Describe the Bug

Hi,

I have an EDI document which contains the UNH2.5 segment. I uploaded an individual schema (attached as XML file) and configured the agreement's send/receive settings as per documentation.

The action "Encode to EDIFACT message by agreement name (V2) (Preview)" worked without problems, and segment UNH2.5 was recognized.

Problem is that every time I use the action “Decode EDIFACT message” it returns error "70: The message has an unknown document type and did not resolve to any of the existing schemas configured in the agreement."

It seems there’s an error in the Agreement and Schema resolution logic for this decoding action of the managed EDIFACT connector. Also tried to decode an EDIFACT without segment UNH2.5 and the issue persists.

Please, see attached XSD schema, JSON agreement and minimal EDI sample (which was encoded via Azure Logic App using "Encode to EDIFACT message by agreement name (V2) (Preview)" with the attached schema and agreement).

Plan Type

Consumption

Steps to Reproduce the Bug or Issue

  1. Create an integration account
  2. Setup partners in integration account
  3. Upload schema in integration account
  4. Setup agreement in integration account
  5. Create a Consumption Logic App
  6. Setup trigger "When a HTTP request is received"
  7. Add action "Decode EDIFACT message"
  8. Set the body of HTTP trigger as the EDIFACT flat file message to decode
  9. Check error "70: The message has an unknown document type and did not resolve to any of the existing schemas configured in the agreement." in the "Bad Messages" section of the response

Workflow JSON

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "contentVersion": "1.0.0.0",
        "triggers": {
            "When_a_HTTP_request_is_received": {
                "type": "Request",
                "kind": "Http",
                "inputs": {
                    "method": "POST"
                }
            }
        },
        "actions": {
            "Decode_EDIFACT_message": {
                "runAfter": {},
                "type": "ApiConnection",
                "inputs": {
                    "host": {
                        "connection": {
                            "name": "@parameters('$connections')['edifact']['connectionId']"
                        }
                    },
                    "method": "post",
                    "body": "@triggerBody()",
                    "path": "/decode",
                    "queries": {
                        "componentSeparator": 58,
                        "dataElementSeparator": 43,
                        "releaseIndicator": 63,
                        "repetitionSeparator": -1,
                        "replacementCharacter": -1,
                        "segmentTerminator": 39,
                        "segmentTerminatorSuffix": "None",
                        "decimalIndicator": "Decimal",
                        "payloadCharacterSet": "UTF8"
                    }
                }
            }
        },
        "outputs": {},
        "parameters": {
            "$connections": {
                "type": "Object",
                "defaultValue": {}
            }
        }
    },
    "parameters": {
        "$connections": {
            "value": {
                "edifact": {
                    "id": "/subscriptions/{removed}/providers/Microsoft.Web/locations/northeurope/managedApis/edifact",
                    "connectionId": "/subscriptions/{removed}/resourceGroups/Test/providers/Microsoft.Web/connections/edifact",
                    "connectionName": "edifact"
                }
            }
        }
    }
}

Screenshots or Videos

No response

Additional context

attachments.zip