【问题标题】:Error 10061 - Connecting to SAP from .Net错误 10061 - 从 .Net 连接到 SAP
【发布时间】:2013-12-31 10:48:33
【问题描述】:

我正在尝试从 .Net 应用程序连接到 SAP 数据库。我想从 SAP 数据库中获取产品列表。我对 SAP 一无所知,正在尝试使用 SAP.Net 连接器进行通信。

我无法成功建立与 SAP 数据库的连接,得到Error 10061 WSAECONNREFUSED。我也禁用了防火墙。

我的 App.config 配置如下。

 <configuration>

   <configSections>
     <sectionGroup name="SAP.Middleware.Connector">
       <sectionGroup name="ClientSettings">
         <section name="DestinationConfiguration" type="SAP.Middleware.Connector.RfcDestinationConfiguration, sapnco"/>
       </sectionGroup>
     </sectionGroup>   </configSections>

   <SAP.Middleware.Connector>    
     <ClientSettings>
       <DestinationConfiguration>
         <destinations>
           <add NAME="DEV" USER="username" PASSWD="password" CLIENT="000"
                LANG="EN" ASHOST="127.0.0.1" SYSNR="00"
                MAX_POOL_SIZE="10" IDLE_TIMEOUT="10"/>
         </destinations>
       </DestinationConfiguration>
     </ClientSettings>   </SAP.Middleware.Connector>
      <startup>
     <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>   </startup>

 </configuration>

代码如下

 RfcDestination SapRfcDestination = RfcDestinationManager.GetDestination("DEV");

 RfcRepository SapRfcRepository = SapRfcDestination.Repository;

第二条语句一执行,我就得到了异常。

异常信息如下

LOCATION    CPIC (TCP/IP) on local host with Unicode
ERROR       partner 'WIN-FHT4V74IPIN:3300' not reached
TIME        Tue Dec 31 02:46:24 2013
RELEASE     720
COMPONENT   NI (network interface)
VERSION     40
RC          -10
MODULE      nixxi.cpp
LINE        3286
DETAIL      NiPConnect2: 192.168.100.123:3300
SYSTEM CALL connect
ERRNO       10061
ERRNO TEXT  WSAECONNREFUSED: Connection refused
COUNTER     1

【问题讨论】:

    标签: .net sap


    【解决方案1】:

    网络连接正在中断。等待,或致电网络管理员。您可以使用验证它

    telnet 127.0.0.1 3300
    

    对了,127.0.0.1是localhost ip地址,你确定是对的吗?

    【讨论】:

    • 网络很好。仍然存在问题。我在 localhost 上运行它,因为 SAP Business One 在同一台机器上。
    猜你喜欢
    • 1970-01-01
    • 2011-10-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多