C# 具有.Net连接器网关的RFC服务器不匹配
我正在开发一个作为RFC服务器运行的非常简单的应用程序。我安装了SAP Netweaver 7.5试用版。以下是启动服务器的代码:C# 具有.Net连接器网关的RFC服务器不匹配,c#,.net,sap-dotnet-connector,sap-gateway,C#,.net,Sap Dotnet Connector,Sap Gateway,我正在开发一个作为RFC服务器运行的非常简单的应用程序。我安装了SAP Netweaver 7.5试用版。以下是启动服务器的代码: private void button2_Click(object sender, EventArgs e) { RfcDestinationManager.RegisterDestinationConfiguration(new RfcDestinationConfig()); RfcServerManager.Regis
private void button2_Click(object sender, EventArgs e)
{
RfcDestinationManager.RegisterDestinationConfiguration(new RfcDestinationConfig());
RfcServerManager.RegisterServerConfiguration(new RfcServerConfig());
Type[] handlers = new Type[1] { typeof(StfcConnectionStaticImpl) };
RfcServer server = RfcServerManager.GetServer("PRD_REG_SERVER", handlers);
server.Start();
}
然后处理类:
class StfcConnectionStaticImpl
{
// The annotation binds the function (name) to its implementation
[RfcServerFunction(Name = "STFC_CONNECTION")]
public static void StfcConnection(RfcServerContext serverContext, IRfcFunction function)
{
Console.WriteLine("System Attributes: " + serverContext.SystemAttributes.ToString());
function.SetValue("ECHOTEXT", function.GetString("REQUTEXT"));
function.SetValue("RESPTEXT", "NCO3: Hello world.");
}
}
接下来是Rfc目标配置类:
public class RfcDestinationConfig : IDestinationConfiguration
{
public event RfcDestinationManager.ConfigurationChangeHandler ConfigurationChanged;
public bool ChangeEventsSupported()
{
return false;
}
public RfcConfigParameters GetParameters(string destinationName)
{
if ("PRD_000".Equals(destinationName))
{
RfcConfigParameters parms = new RfcConfigParameters();
parms.Add(RfcConfigParameters.AppServerHost, "172.18.3.22");
parms.Add(RfcConfigParameters.SystemNumber, "00");
parms.Add(RfcConfigParameters.User, "developer");
parms.Add(RfcConfigParameters.Password, "Appl1ance");
parms.Add(RfcConfigParameters.Client, "001");
parms.Add(RfcConfigParameters.Language, "EN");
parms.Add(RfcConfigParameters.PoolSize, "5");
parms.Add(RfcConfigParameters.MaxPoolSize, "10");
parms.Add(RfcConfigParameters.IdleTimeout, "600");
return parms;
}
else return null;
}
}
最后是Rfc服务器类:
public class RfcServerConfig : IServerConfiguration
{
public event RfcServerManager.ConfigurationChangeHandler ConfigurationChanged;
public bool ChangeEventsSupported()
{
return false;
}
public RfcConfigParameters GetParameters(string serverName)
{
if ("PRD_REG_SERVER".Equals(serverName))
{
RfcConfigParameters parms = new RfcConfigParameters();
parms.Add(RfcConfigParameters.GatewayHost, "172.18.3.22");
parms.Add(RfcConfigParameters.GatewayService, "sapgw00");
parms.Add(RfcConfigParameters.ProgramID, "DOT_NET_SERVER");
parms.Add(RfcConfigParameters.RepositoryDestination, "PRD_000");
parms.Add(RfcConfigParameters.RegistrationCount, "5");
return parms;
}
else return null;
}
}
服务器启动良好,我在网关中的注册正常
问题来自登录的客户端,因为我只看到外部客户端,而没有看到注册的程序:
我的问题是为什么我不把程序作为注册服务器
是否有一些SAP配置允许程序注册
如果有人不能帮我解决这个问题,那就太好了
谢谢,
罗南