今天发现一个vendor没办法通过AS2给我们送EDI 832/846文件,去IIS log中查了下都是HTTP 404.13错误,看来是HTTP request数据超长了(vendor给的832/846基本都是60MB左右的),日志如下:
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken
2011-10-04 05:28:56 172.16.70.45 POST /EdiIntReceive/ - 8004 - 172.16.72.140 haboob/5.5.2.0.8+build-3181 404 13 0 62
以前配过IIS 6.0的,记得是改web.config就可以了,但IIS 7.0还没搞过,有点摸不着地方,试过web.config加<httpRuntime>节点但也没起作用。Google了一下终于找到了方法,而且很简单,找到虚拟目录属性中的Request Filtering选项,按照图中以下步骤,将maximum allowed content length设置大一点,比如到100 MB, 这样就能够接收大于默认值30000000 Bytes的http流了。
以上solution是针对接收端的,实际上作为AS2发送端的vendor也可以通过一点小的配置修改就能够来搞定问题,只需要将HTTP request改为chunked encoding,也就是分包来发送数据就可以了,比较以下两个HTTP header就能够说明问题
Non-chunked encoding
Connection: Keep-Alive
Content-Length: 58738800
Content-Type: APPLICATION/EDI-X12
…
chunked encoding
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: APPLICATION/EDI-X12
…
在Biztalk server中,可以在send port上这样设置来打开chunked encoding:
记下来,怕以后忘记了~
阅读全文
Biztalk 2006 R2中使用集成的EDI Outbound Batching能够很容易地实现打包发送EDI文档的功能。
以下是在EDI Outbound Batching中起重要作用的4个Promoted Context:
EDI.ToBeBatched
EDI.ToBeRouted
EDI.DestinationPartyID
EDI.EncodingType
以及集成在Biztalk EDI Application中的3个Orchestration
Microsoft.BizTalk.Edi.BatchSuspendOrchestration.BatchElementSuspendService
Microsoft.BizTalk.Edi.BatchingOrchestration.Ba阅读全文以下是Biztalk EDI X12文件的schema中使用到各种数据类型:
X12_N - 数字类型(integer)
X12_R - 实数类型(real)。 格式为 [sign]integral-digits[.[fractional-digits]], Sign(符号)只能是“-”,不允许是“+”
注意:
在VS2005 IDE中使用shema来验证xml实例,若该类型的节点内容前后带有数字"0"或着空格时(如12.20, 005),会出现类似以下的错误提示
Error 16 Segment level : Field Error : Segment ID - MEA : Field Position - 3 : Current value - 12.20 : [6] Invalid character in data element
这种xml实例无论如何也通不过shema验证,
不过只要在Party的EDI属性X12 Properties -> Party as Interchage Sender -> ACK Generation and Validation Settings中,
将Allow leading and trailing zeros and spaces复选框勾上,那么在EDI pipeline进行解析的运行时就可以让这种xml通过验证了
X12_AN - 字符或数字类型(alphanumeric)
X12_ID - 枚举类型
X12_DT - 日期类型(DateTime)
X12_TM - 时间类型(Time)
X12_Nx - 指定了小数位的数字类型。x > 0,假如设定为"N2",则代表x12文件经过pipeline解析后数值1234会转换为12.34
注意:
激活自动转换的功能需要在Party的EDI属性X12 Properties -> Party as Interchage Sender -> ACK Generation and Validation Settings中,
将Convert implied decimal format Nn to base 10 numeric value复选框勾上
--其实着以上类型都与ANSI EDI X12文档的标准类型定义是一致的

