sapnco3 接收IDOC准备工作:安装sapcon3.0_X64.rar 或 Setup_ntintel_301_32位安装包.rar。并将安装目录下的dll引用到工程项目中
当与SAP进行数据交互,作为Server的时候,需要注册客户端和服务端,并在服务端提供SAP调用的函数,示例中供SAP调用的函数名为IDOC_INBOUND_ASYNCHRONOUS
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using SAP.Middleware.Connector; 6 7 8 9 namespace Sapnoc30Demo_Yan 10 { 11 12 public class SapncoClient 13 { 14 private RfcDestination _rfcDestination = null; 15 16 /// <summary> 17 /// Register Client 18 /// </summary> 19 public void RegisterRfcDestination() 20 { 21 try 22 { 23 if (_rfcDestination == null) 24 _rfcDestination = RfcDestinationManager.GetDestination("NCO_Destination"); //获取 config配置中NCO_Destination节点参数,并注册RfcClient 25 } 26 catch (Exception ex) 27 { 28 throw ex; 29 } 30 } 31 } 32 }