Skip to content

ERPConnect.RFCServer

Namespace: ERPConnect
Assembly: ERPConnectStandard20.dll

RFCServer represents a running server, that can handle incoming RFC calls from a superposed SAP system

public sealed class RFCServer : IDisposable

Inheritance

objectRFCServer

Implements

IDisposable

Inherited Members

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

RFCServer()

Initializes a RFCServer object

public RFCServer()

RFCServer(bool)

Initializes a new instance of the RFCServer class

public RFCServer(bool nonUnicodeIsBigEndian)

Parameters

nonUnicodeIsBigEndian bool

Indicates, whether non-Unicode systems are treated as big endian systems

RFCServer(string, string, string)

Initializes a RFCServer object

public RFCServer(string gatewayHost, string gatewayService, string programId)

Parameters

gatewayHost string

Name of the Gateway host

gatewayService string

Name of the Gateway service ("sapgwXX" -> XX = system number)

programId string

Program ID as defined in SM59

RFCServer(string)

Initializes a RFCServer object

public RFCServer(string connectionString)

Parameters

connectionString string

Connection String

RFCServer(string, string, string, SNCSettings)

Initializes a RFCServer object

public RFCServer(string gatewayHost, string gatewayService, string programId, SNCSettings sncSettings)

Parameters

gatewayHost string

Name of the Gateway host

gatewayService string

Name of the Gateway service ("sapgwXX" -> XX = system number)

programId string

Program ID as defined in SM59

sncSettings SNCSettings

Settings for SNC

Properties

CanReceiveIdocs

Defines, whether the server object should be able to receive idocs.

public bool CanReceiveIdocs { get; set; }

Property Value

bool

GatewayHost

Name of the gatewayhost

public string GatewayHost { get; set; }

Property Value

string

Remarks

Have a look at ERPConnect.RFCServer.Start?text=ERPConnect.RFCServer.Start for a complete example.

GatewayService

Name of the gateysevice ("sapgwXX" replace XX by the SAP system number)

public string GatewayService { get; set; }

Property Value

string

Remarks

Have a look at ERPConnect.RFCServer.Start?text=ERPConnect.RFCServer.Start for a complete example.

IsRunning

Defines, whether the server thread is running at the moment

public bool IsRunning { get; }

Property Value

bool

Remarks

Have a look at ERPConnect.RFCServer.Start?text=ERPConnect.RFCServer.Start for a complete example.

IsUnicode

Defines whether the partner system is a unicode system

public bool IsUnicode { get; set; }

Property Value

bool

LastTID

Transaction ID of last incoming call

public string LastTID { get; }

Property Value

string

LogDir

If this directory is set, every call will be saved there in a XML file

public string LogDir { get; set; }

Property Value

string

Logging

Defines, if the calls will be logged to local trace file.

public bool Logging { get; set; }

Property Value

bool

ProgramID

ProgrammID as definied in the RFC destintion (Transaction SM59)

public string ProgramID { get; set; }

Property Value

string

Remarks

Have a look at ERPConnect.RFCServer.Start?text=ERPConnect.RFCServer.Start for a complete example.

Protocol

Gets or sets the communication protocol/API

public ClientProtocol Protocol { get; set; }

Property Value

ClientProtocol

RegisteredFunctions

A collection of all RFCServerFunction objects that the connected SAP system can call.

public RFCServerFunctionCollection RegisteredFunctions { get; }

Property Value

RFCServerFunctionCollection

Remarks

Have a look at ERPConnect.RFCServer.Start?text=ERPConnect.RFCServer.Start for a complete example.

SAPEncodingInfo

Gets information about data encoding

public SAPEncodingInfo SAPEncodingInfo { get; }

Property Value

SAPEncodingInfo

SNCSettings

Gets or sets the settings for SNC

public SNCSettings SNCSettings { get; set; }

Property Value

SNCSettings

Methods

CancelRegisteredServers()

Ends all servers that are registered with the given Program ID at the SAP Host

public void CancelRegisteredServers()

Dispose()

public void Dispose()

\~RFCServer()

protected ~RFCServer()

Log(string)

public void Log(string message)

Parameters

message string

Start()

Starts the server.

public void Start()

Remarks

Please make sure to have all server functions defined, before starting the server.

Start(bool)

Starts the server.

public void Start(bool blocking)

Parameters

blocking bool

Defines whether the server should run in an own thread (false) or not (true).

Remarks

Please make sure to have all server functions defined, before starting the server.

Stop()

Stop the running server

public void Stop()

Remarks

Have a look at ERPConnect.RFCServer.Start?text=ERPConnect.RFCServer.Start for a complete example.

Authorizing

Authorizing is fired, when the RFC Server is authorizing an incoming function call. If this event has no subscribers, all calls are authorized. Otherwise AuthorizingEventArgs.IsAuthorized must be set to 'true' to authorize a call.

public event RFCServer.OnAuthorizing Authorizing

Event Type

RFCServer.OnAuthorizing

IncomingCall

IncomingCall is fired, when the SAP system call the RFC server

public event RFCServer.OnIncomingCall IncomingCall

Event Type

RFCServer.OnIncomingCall

IncomingIdoc

IncomingIdoc is fired, when the SAP system calls the RFC Server to send an idoc

public event RFCServer.OnIncomingIdoc IncomingIdoc

Event Type

RFCServer.OnIncomingIdoc

InternalException

An error occured within the server object while the server is running

public event RFCServer.OnInternalException InternalException

Event Type

RFCServer.OnInternalException

Logged

public event EventHandler<LoggedEventArgs> Logged

Event Type

EventHandler<LoggedEventArgs>

Started

Fires after the server has been started

public event EventHandler<EventArgs> Started

Event Type

EventHandler<EventArgs>

Stopped

Fires after the server has been stopped

public event EventHandler<EventArgs> Stopped

Event Type

EventHandler<EventArgs>

TRFCCheckTID

TRFCCheckTID is fired, when the SAP system wants the client to check, if a call can be sent.

public event RFCServer.OnTRFCCheckTID TRFCCheckTID

Event Type

RFCServer.OnTRFCCheckTID

TRFCCommit

TRFCCommit is fired, when the SAP system wants to have an Transaktion comitted

public event RFCServer.OnTRFCCommit TRFCCommit

Event Type

RFCServer.OnTRFCCommit

TRFCConfirm

TRFCConfirm is fired, when the SAP system a transaction to be rolled back due to an error.

public event RFCServer.OnTRFCConfirm TRFCConfirm

Event Type

RFCServer.OnTRFCConfirm

TRFCRollback

TRFCRollback is fired, when the SAP system a transaction to be rolled back due to an error.

public event RFCServer.OnTRFCRollback TRFCRollback

Event Type

RFCServer.OnTRFCRollback

UnknownIncomingFunction

UnknownIncomingFunction is fired, when the SAP system calls a function module that is not contained in the RegisteredFunctions collection.

public event RFCServer.OnUnknownIncomingFunction UnknownIncomingFunction

Event Type

RFCServer.OnUnknownIncomingFunction