我正在从Azure队列中读取X12 850并寻求获取它的XML表示,由Logic Apps解码。以下是我正在使用的示例EDI文档:
ISA*00* *00* *12*TEST123ZZZ *12*ZZZ123TEST *171010*0705*U*00401*000032485*0*P*>~
GS*PO*TEST123ZZZ*ZZZ123TEST*20171010*070547*32485*X*004010~
ST*850*32485~
BEG*00*SA*Z-5000**20171010~
REF*PG*LLL~
DTM*002*20171113~
N1*ST*SUPERLATIVE AUTO PARTS INC.*92*4500~
N3*5555 33 MILE RD.~
N4*ARMADA*MI*48005~
PO1*1*10*EA*2.27**BP*P2224*VP*L033~
PO1*2*10*EA*5.53**BP*P5544*VP*L059~
PO1*3*10*EA*4.11**BP*P1237*VP*L020~
PO1*4*20*EA*16.3**BP*P0999*VP*L006~
CTT*4*50~
SE*13*32485~
GE*1*32485~
IEA*1*000032485~
Out of Decode,我在goodMessages中没有得到任何东西,而是在badMessages中。在我看来,我的协议正在被接收和使用(我已经建立的唯一协议),但我对如何回应异常"与id 000032485
的交换感到茫然,发件人ID 'TEST123ZZZ '
,收件人ID 'ZZZ123TEST '
在第一个功能组之前/之前有结构错误"
"body": {
"interchangeControlNumber": "000032485",
"groupControlNumbers": [],
"goodMessages": [],
"badMessages": [
{
"interchangeEnvelope": {
"ISA_Segment": "ISA*00* *00* *12*TEST123ZZZ *12*ZZZ123TEST *171010*0705*U*00401*000032485*0*P*>~\r\n",
"isA05": "12",
"isA06": "TEST123ZZZ ",
"isA07": "12",
"isA08": "ZZZ123TEST ",
"isA09": "171010",
"isA10": "0705",
"isA11": "U",
"isA12": "00401",
"isA13": "000032485",
"isA14": "0",
"isA15": "P"
},
"technicalAckExpected": false,
"functionalAckExpected": false,
"exception": "The interchange with id '000032485', with sender id TEST123ZZZ , receiver id ZZZ123TEST had structural error in/before the first functional group",
"componentSeparator": 62,
"dataElementSeparator": 42,
"interchangeControlNumber": "000032485",
"payload": "77u/R1MgKiBQTyAqIFRFU1QxMjNaWlogKiBaWloxMjNURVNUICogMjAxNzEwMTAgKiAwNzA1NDcgKiAzMjQ4NSAqIFggKiAwMDQwMTB+DQpTVCAqIDg1MCAqIDMyNDg1fg0KQkVHICogMDAgKiBTQSAqIFogLSA1MDAwICogKjIwMTcxMDEwfg0KUkVGICogUEcgKiBMTEx+DQpEVE0gKiAwMDIgKiAyMDE3MTExM34NCk4xICogU1QgKiBTVVBFUkxBVElWRSBBVVRPIFBBUlRTIElOQy4qIDkyICogNDUwMH4NCk4zICogNTU1NSAzMyBNSUxFIFJELn4NCk40ICogQVJNQURBICogTUkgKiA0ODAwNX4NClBPMSAqIDEgKiAxMCAqIEVBICogMi4yNyAqICpCUCAqIFAyMjI0ICogVlAgKiBMMDMzfg0KUE8xICogMiAqIDEwICogRUEgKiA1LjUzICogKkJQICogUDU1NDQgKiBWUCAqIEwwNTl+DQpQTzEgKiAzICogMTAgKiBFQSAqIDQuMTEgKiAqQlAgKiBQMTIzNyAqIFZQICogTDAyMH4NClBPMSAqIDQgKiAyMCAqIEVBICogMTYuMyAqICpCUCAqIFAwOTk5ICogVlAgKiBMMDA2fg0KQ1RUICogNCAqIDUwfg0KU0UgKiAxMyAqIDMyNDg1fg0KR0UgKiAxICogMzI0ODV+DQpJRUEgKiAxICogMDAwMDMyNDg1fg==",
"replacementCharacter": 0,
"segmentTerminator": 126,
"segmentTerminatorSuffix": "CRLF",
"agreementName": "X12-TEST123ZZZ-ZZZ123TEST",
"guestPartnerName": "Test-Partner",
"hostPartnerName": "Plex-As-Host",
"ReceiverIdentifier": "ZZZ123TEST",
"receiverQualifier": "12",
"SenderIdentifier": "TEST123ZZZ",
"senderQualifier": "12"
}
],
"generatedAcks": [],
"receivedAcks": [],
"agreementName": "X12-TEST123ZZZ-ZZZ123TEST",
"guestPartnerName": "Test-Partner",
"hostPartnerName": "Plex-As-Host",
"ReceiverIdentifier": "ZZZ123TEST",
"receiverQualifier": "12",
"SenderIdentifier": "TEST123ZZZ",
"senderQualifier": "12"
}
}
我的EDI同事告诉我,#ISA; ISA02应该是10个空格
ISA段的总长度应为106个字符"所以,我想我没有为ISA2正确配置协议。我应该在协议中的ISA2字段中放置一些东西吗?我尝试了十个空格,但我仍然得到同样的错误:"标识为000032485
的转换,发件人ID TEST123ZZZ
,接收者标识ZZZ123TEST
存在结构错误在第一个职能部门之前/之前"
答案 0 :(得分:0)
您的ISA细分在结构上看起来很好。 ISA02 / 04通常留空。
但是看看其他内容,是不是还有一个空间呢?那会引起问题。只允许CR和/或LF作为suffex。
答案 1 :(得分:0)
似乎有些EDI验证器在处理没有子元素的PO1
循环时遇到问题。
以下消息通过验证,将MSG
段作为子节点到PO1:
ISA*00* *00* *12*TEST123ZZZ *12*ZZZ123TEST *171010*0705*U*00401*000032485*0*P*>~
GS*PO*TEST123ZZZ*ZZZ123TEST*20171010*070547*32485*X*004010~
ST*850*32485~
BEG*00*SA*Z-5000**20171010~
REF*PG*LLL~
DTM*002*20171113~
N1*ST*SUPERLATIVE AUTO PARTS INC.*92*4500~
N3*5555 33 MILE RD.~
N4*ARMADA*MI*48005~
PO1*1*10*EA*2.27**BP*P2224*VP*L033~
MSG*LINE ITEM 1~
PO1*2*10*EA*5.53**BP*P5544*VP*L059~
MSG*LINE ITEM 2~
PO1*3*10*EA*4.11**BP*P1237*VP*L020~
MSG*LINE ITEM 3~
PO1*4*20*EA*16.3**BP*P0999*VP*L006~
MSG*LINE ITEM 4~
CTT*4*50~
SE*17*32485~
GE*1*32485~
IEA*1*000032485~
我使用在线EDI验证器对此进行了测试:http://edivalidation.com/valid.html
答案 2 :(得分:0)
我实际上有两个问题需要解决。两者都与我编写的控制台应用程序有关,它将消息发送到Logic App读取的Azure Queue中。将EDI文档作为值传递给字符串变量最终会看到在星号周围注入的间距。这是第一个问题。借调,将BrokeredMessage放入队列,我必须使用显式的MemoryStream来确定内容是否被改变(正在添加额外的字符),如此处所述http://www.bfcamara.com/post/84113031238/send-a-message-to-an-azure-service-bus-queue-with
一旦我纠正了这两个问题(并配置了我的集成帐户以保留解码时的交换细节),我成功地看到逻辑应用程序将X12解码为XML。