Azure逻辑应用程序 - 平面文件解码返回随机字符串

时间:2017-10-18 10:40:21

标签: schema biztalk flat-file azure-logic-apps

我想使用架构将平面文件解码为XML但是我在输出中得到了一些随机字符串返回。我在企业集成包中使用平面文件解码连接器。你能帮忙吗?

这是我的输入

{  
  "content": "PO1999-10-20\r\nUS        Alice Smith         123 Maple Street    Mill Valley    CA 90952\r\nUS        Robert Smith        8 Oak Avenue        Old Town       PA 95819\r\nITEMS,ITEM872-AA|Lawnmower|1|148.95|Confirm this is electric,ITEM926-AA|Baby Monitor|1|39.98|Confirm this is electric", 
  "integrationAccount": 
  {
        "schema": {            "name": "FlatFile"        }    
  }
}

这是我的输出

{    
  "body": 
  {        
       "$content-type": "application/xml;charset=utf-8",        
       "$content": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxQTyB4bWxucz0iaHR0cDovL0JpelRhbGtfU2VydmVyX1Byb2plY3QxLlBPIj4NCiAgPGRhdGUgeG1sbnM9IiI+MTk5OS0xMC0yMDwvZGF0ZT4NCiAgPGN1c3RvbWVyIHhtbG5zPSIiPg0KICAgIDxjb3VudHJ5PlVTPC9jb3VudHJ5Pg0KICAgIDxGdWxsTmFtZT5BbGljZSBTbWl0aDwvRnVsbE5hbWU+DQogICAgPFN0cmVldD4xMjMgTWFwbGUgU3RyZWV0PC9TdHJlZXQ+DQogICAgPENpdHk+TWlsbCBWYWxsZXk8L0NpdHk+DQogICAgPFN0YXRlPkNBPC9TdGF0ZT4NCiAgICA8UG9zdGFsQ29kZT45MDk1MjwvUG9zdGFsQ29kZT4NCiAgPC9jdXN0b21lcj4NCiAgPGN1c3RvbWVyIHhtbG5zPSIiPg0KICAgIDxjb3VudHJ5PlVTPC9jb3VudHJ5Pg0KICAgIDxGdWxsTmFtZT5Sb2JlcnQgU21pdGg8L0Z1bGxOYW1lPg0KICAgIDxTdHJlZXQ+OCBPYWsgQXZlbnVlPC9TdHJlZXQ+DQogICAgPENpdHk+T2xkIFRvd248L0NpdHk+DQogICAgPFN0YXRlPlBBPC9TdGF0ZT4NCiAgICA8UG9zdGFsQ29kZT45NTgxOTwvUG9zdGFsQ29kZT4NCiAgPC9jdXN0b21lcj4NCiAgPGl0ZW1zIHhtbG5zPSIiPg0KICAgIDxpdGVtc19DaGlsZDE+DQogICAgICA8cHJvZHVjdENvZGU+ODcyLUFBPC9wcm9kdWN0Q29kZT4NCiAgICAgIDxEZXNjcmlwdGlvbj5MYXdubW93ZXI8L0Rlc2NyaXB0aW9uPg0KICAgICAgPFF1YW50aXR5PjE8L1F1YW50aXR5Pg0KICAgICAgPFVuaXRQcmljZT4xNDguOTU8L1VuaXRQcmljZT4NCiAgICAgIDxOb3Rlcz5Db25maXJtIHRoaXMgaXMgZWxlY3RyaWM8L05vdGVzPg0KICAgIDwvaXRlbXNfQ2hpbGQxPg0KICAgIDxpdGVtc19DaGlsZDE+DQogICAgICA8cHJvZHVjdENvZGU+OTI2LUFBPC9wcm9kdWN0Q29kZT4NCiAgICAgIDxEZXNjcmlwdGlvbj5CYWJ5IE1vbml0b3I8L0Rlc2NyaXB0aW9uPg0KICAgICAgPFF1YW50aXR5PjE8L1F1YW50aXR5Pg0KICAgICAgPFVuaXRQcmljZT4zOS45ODwvVW5pdFByaWNlPg0KICAgICAgPE5vdGVzPkNvbmZpcm0gdGhpcyBpcyBlbGVjdHJpYzwvTm90ZXM+DQogICAgPC9pdGVtc19DaGlsZDE+DQogIDwvaXRlbXM+DQo8L1BPPg=="    
  }

这是我Apache Groovy - Why and How You Should Use It

的架构

2 个答案:

答案 0 :(得分:2)

“随机字符串”实际上是base64编码的字符串。

在此测试,例如:https://www.base64decode.org/

您必须使用转换器函数@base64toString()解码文件内容。有关详细信息,请参阅以下MSDN页面:https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-content-type,在Application/xml and Application/octet-stream and converter functions部分下。

答案 1 :(得分:1)

您所看到的是正确的。

您看到的是平面文件解码器的 Base64编码Xml 输出。如果您在文本编辑器中解码该字符串,您将看到Xml。

这就是LogicApp引擎内部工作的方式。当您尝试使用它时,它会自动解码$ content的内容。

基本上,你很好。没问题:)