Question

I am trying to connect to SAP database from .Net application. I want to fetch a list of products from SAP database. I know nothing about SAP, trying to communicate using SAP.Net connector.

I am not able to establish connection with SAP database successfully, getting Error 10061 WSAECONNREFUSED. I've disabled firewall as well.

I've configured my App.config as below.

 <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>

Code in code is as below

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

 RfcRepository SapRfcRepository = SapRfcDestination.Repository;

I get the exception as soon as second statement is executed.

The Exception message is as below

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
Was it helpful?

Solution

Network connection is down on the way. Wait, or call network administrator. You can verify it using

telnet 127.0.0.1 3300

By the way, 127.0.0.1 is localhost ip address, are you sure it is right?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top