[英]Error 10061 - Connecting to SAP from .Net
我正在尝试从.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
网络连接即将中断。 等待,或致电网络管理员。 您可以使用进行验证
telnet 127.0.0.1 3300
顺便说一句, 127.0.0.1
是本地主机的IP地址,您确定它是正确的吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.