码迷,mamicode.com
首页 > 其他好文 > 详细

BizTalk使用SAP DATA TYPES

时间:2014-10-10 20:04:44      阅读:224      评论:0      收藏:0      [点我收藏+]

标签:des   blog   http   io   os   使用   ar   for   sp   

When sending a document to SAP, or making a RFC or BAPI call you may get this error:
 
Microsoft.ServiceModel.Channels.Common.XmlReaderGenerationException: An error occurred when trying to convert the byte array [30-00-30-00-30-00-30-00-30-00-30-00-30-00-30-00] of RFCTYPE RFCTYPE_DATE with length 8 and decimals 0 to XML format. Parameter/field name: REF_DATE   Error message: Year, Month, and Day parameters describe an un-representable DateTime. ---> System.ArgumentOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime.
 
Usually its the date field, most likely one you do not even use, and do not care about,  sadly SAP date format is different from yours, and a null date is a big no no. 
 
It comes down to how you generated your SAP schemas in the first place. 
 
 Add Generated Items/Add Adapter Meta Data/WCF-SAP 
 
Under the Configure Button are three tabs, set up your connection on the first two, and then there is binding properties.
 bubuko.com,布布扣
 
 
 
 
Look at the metadata section, change the Enable Safe Typing to true, this will generate your schema with safe types, its a fancy way of saying that all of the types generated will be of type string, rather than of type datetime, long, int, etc...  SAP does not seem to care, it will do the conversion correctly now.
 
The node names do not change, just the types, so you can simply replace your current schema, keeping the same name, with the definition generated now. 
 
Then your problem, will go away, and SAP will once again be happy. 
AT RUN TIME: Ensure your send or receive port also has the same setting or it will not work. 
 

BizTalk使用SAP DATA TYPES

标签:des   blog   http   io   os   使用   ar   for   sp   

原文地址:http://www.cnblogs.com/asjiang/p/4016282.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!