locked
X12 decoder with AS2 decoder RRS feed

  • Question

  • Hi ,

    I am using X12 decoder after AS2 decoder action. I selected Content(Message content) from AS2 decoder  as input to X12 decoder.

    When i run this logic app, there is a failure at X12 decoder.

    Input  

    { "host": { "api": { "runtimeUrl": "https://logic-apis-westeurope.azure-apim.net/apim/x12" }, "connection": { "name": "/subscriptions/127ac5ca-b847-4641-b442-c607fbb4c098/resourceGroups/BrainplantRG/providers/Microsoft.Web/connections/x12" } }, "method": "post", "path": "/decode", "body": "SVNBKjAwKiAgICAgICAgICAqMDAqICAgICAgICAgICpaWipDb250b3NvU2FsZXMgICAqWloqQnJhaW5wbGFudFNhbGVzKjk5MTIwMSoxMTU3KlUqMDA0MDEqMDAwMDAwMDQ0KjAqVCo+fg0KR1MqUE8qQ29udG9zb0NSTSpVUyoyMDE2MDcyNyoxNjAxKjExMSpYKjAwNDAxMH4NClNUKjg1MCowMDAxfg0KQkVHKjAwKk5FKjM4NTkxOTk4MzgqKjk1MDcyNyoqKklCTX4NClBFUipBQSpTcmluaSBDYXJsc29uKlRFKig3MDgpIDU1NS0yOTMwfg0KRFRNKjAwMio5NzA1MjN+DQpQTzEqMSo5MypCWCoxNDUuMzkqKkNCKktPVy0yMjIyMjItMTB+DQpQSUQqRioqKipVbmludGVycnVwdGlibGUgUG93ZXIgU3lzdGVtfg0KUEVSKkFBKkNhbWlsbGEgQW5kZXJzb24qVEUqKDcwOCkgNTU1LTIwMTF+DQpQTzEqMioyNSpFQSozNS42OCoqQ0IqMTA5My00OTI3LTAwMX4NClBJRCpGKioqKkhpZ2ggVm9sdW1lIFByaW50ZXIgU3RhbmR+DQpQRVIqQUEqTWlyYW5kYSBDYXBwZWxhbipURSooNzA4KSA1NTUtMTExMX4NClBPMSozKjQqUEMqMjAwMi45MSoqQ0IqQUJYLTIwMDF+DQpQSUQqRioqKipFbGVjdHJvbmljcyBDYWJpbmV0IFBhY2thZ2UgKDU2IiBIaWdoKX4NCkNUVCozfg0KU0UqMTQqMDAwMX4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bWUgUHJpbnRlciBTdGFuZH4NClBFUipBQSpNaXJhbmRhIENhcHBlbGFuKlRFKig3MDgpIDU1NS0xMTExfg0KUE8xKjMqNCpQQyoyMDAyLjkxKipDQipBQlgtMjAwMX4NClBJRCpGKioqKkVsZWN0cm9uaWNzIENhYmluZXQgUGFja2FnZSAoNTYiIEhpZ2gpfg0KQ1RUKjN+DQpTRSoxNCowMDAzfg0KU1QqODUwKjAwMDR+DQpCRUcqMDAqTkUqMzg1OTE5OTgzOCoqOTUwNzI3KioqSUJNfg0KUEVSKkFBKkFuZHJldyBDYXJsc29uKlRFKig3MDgpIDU1NS0yOTMwfg0KRFRNKjAwMio5NzA1MjN+DQpQTzEqMSo5MypCWCoxNDUuMzkqKkNCKktPVy0yMjIyMjQtMTB+DQpQSUQqRioqKipVbmludGVycnVwdGlibGUgUG93ZXIgU3lzdGVtfg0KUEVSKkFBKkNhbWlsbGEgQW5kZXJzb24qVEUqKDcwOCkgNTU1LTIwMTF+DQpQTzEqMioyNSpFQSozNS42OCoqQ0IqMTA5My00OTI3LTAwMX4NClBJRCpGKioqKkhpZ2ggVm9sdW1lIFByaW50ZXIgU3RhbmR+DQpQRVIqQUEqTWlyYW5kYSBDYXBwZWxhbipURSooNzA4KSA1NTUtMTExMX4NClBPMSozKjQqUEMqMjAwMi45MSoqQ0IqQUJYLTIwMDF+DQpQSUQqRioqKipFbGVjdHJvbmljcyBDYWJpbmV0IFBhY2thZ2UgKDU2IiBIaWdoKX4NCkNUVCozfg0KU0UqMTQqMDAwNH4NCkdFKjIqMjIyfg0KSUVBKjIqMDAwMDAwMDI3" }

    OutPut

    • { "statusCode": 400, "headers": { "Pragma": "no-cache", "x-ms-request-id": "ef23260b-a82f-4396-865c-c2590dc9cb86", "Cache-Control": "no-cache", "Date": "Mon, 12 Sep 2016 22:41:56 GMT", "Set-Cookie": "ARRAffinity=c81df84e4118b050f97aee33a1ec0664c5319b97beadbb25f99be77f6eaecef3;Path=/;Domain=127.0.0.1", "Server": "Microsoft-IIS/8.0,Microsoft-HTTPAPI/2.0", "X-AspNet-Version": "4.0.30319", "X-Powered-By": "ASP.NET", "Content-Length": "100", "Content-Type": "application/json; charset=utf-8", "Expires": "-1" }, "body": { "status": 400, "message": "The protocol of the message could not be recognized.", "source": "127.0.0.1" }

    Just to confirm that AS2 decoder is working fine, i sent out the output of the AS2 decoder to one drive and it looks like content which is coming out of AS2 decoder is a compressed content.

    SVNBKjAwKiAgICAgICAgICAqMDAqICAgICAgICAgICpaWipDb250b3NvU2FsZXMgICAqWloqQnJhaW5wbGFudFNhbGVzKjk5MTIwMSoxMTU3KlUqMDA0MDEqMDAwMDAwMDQ0KjAqVCo+fg0KR1MqUE8qQ29udG9zb0NSTSpVUyoyMDE2MDcyNyoxNjAxKjExMSpYKjAwNDAxMH4NClNUKjg1MCowMDAxfg0KQkVHKjAwKk5FKjM4NTkxOTk4MzgqKjk1MDcyNyoqKklCTX4NClBFUipBQSpTcmluaSBDYXJsc29uKlRFKig3MDgpIDU1NS0yOTMwfg0KRFRNKjAwMio5NzA1MjN+DQpQTzEqMSo5MypCWCoxNDUuMzkqKkNCKktPVy0yMjIyMjItMTB+DQpQSUQqRioqKipVbmludGVycnVwdGlibGUgUG93ZXIgU3lzdGVtfg0KUEVSKkFBKkNhbWlsbGEgQW5kZXJzb24qVEUqKDcwOCkgNTU1LTIwMTF+DQpQTzEqMioyNSpFQSozNS42OCoqQ0IqMTA5My00OTI3LTAwMX4NClBJRCpGKioqKkhpZ2ggVm9sdW1lIFByaW50ZXIgU3RhbmR+DQpQRVIqQUEqTWlyYW5kYSBDYXBwZWxhbipURSooNzA4KSA1NTUtMTExMX4NClBPMSozKjQqUEMqMjAwMi45MSoqQ0IqQUJYLTIwMDF+DQpQSUQqRioqKipFbGVjdHJvbmljcyBDYWJpbmV0IFBhY2thZ2UgKDU2IiBIaWdoKX4NCkNUVCozfg0KU0UqMTQqMDAwMX4NClNUKjg1MCowMDAyfg0KQkVHKjAwKk5FKjM4NTk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mRhIENhcHBlbGFuKlRFKig3MDgpIDU1NS0xMTExfg0KUE8xKjMqNCpQQyoyMDAyLjkxKipDQipBQlgtMjAwMX4NClBJRCpGKioqKkVsZWN0cm9uaWNzIENhYmluZXQgUGFja2FnZSAoNTYiIEhpZ2gpfg0KQ1RUKjN+DQpTRSoxNCowMDAzfg0KU1QqODUwKjAwMDR+DQpCRUcqMDAqTkUqMzg1OTE5OTgzOCoqOTUwNzI3KioqSUJNfg0KUEVSKkFBKkFuZHJldyBDYXJsc29uKlRFKig3MDgpIDU1NS0yOTMwfg0KRFRNKjAwMio5NzA1MjN+DQpQTzEqMSo5MypCWCoxNDUuMzkqKkNCKktPVy0yMjIyMjQtMTB+DQpQSUQqRioqKipVbmludGVycnVwdGlibGUgUG93ZXIgU3lzdGVtfg0KUEVSKkFBKkNhbWlsbGEgQW5kZXJzb24qVEUqKDcwOCkgNTU1LTIwMTF+DQpQTzEqMioyNSpFQSozNS42OCoqQ0IqMTA5My00OTI3LTAwMX4NClBJRCpGKioqKkhpZ2ggVm9sdW1lIFByaW50ZXIgU3RhbmR+DQpQRVIqQUEqTWlyYW5kYSBDYXBwZWxhbipURSooNzA4KSA1NTUtMTExMX4NClBPMSozKjQqUEMqMjAwMi45MSoqQ0IqQUJYLTIwMDF+DQpQSUQqRioqKipFbGVjdHJvbmljcyBDYWJpbmV0IFBhY2thZ2UgKDU2IiBIaWdoKX4NCkNUVCozfg0KU0UqMTQqMDAwNH4NCkdFKjIqMjIyfg0KSUVBKjIqMDAwMDAwMDI3

    Can you please help me to get correct content out from AS2 decoder? attaching few screen shots. 

    Thanks

    Srinivasa Mahendrakar

    Monday, September 12, 2016 11:14 PM

Answers

  • I found solution for this. 

    we need to extract the correct content by using function @base64ToString(body('Decode_AS2_message')?['aS2Message']?['content'])

    The link https://azure.microsoft.com/en-us/documentation/articles/app-service-logic-enterprise-integration-b2b/ shows X12 decoder stage using the above function. However it is not quite correct in terms of field names. 

    Using expression @base64ToString(body('Decode_AS2_message')?['aS2Message']?['content']) should fix the issue.

    Thanks

    Srinivasa mahendrakar

    Tuesday, September 13, 2016 12:01 AM