在与SAP Quality System连接时,如果遇到了异常,则会发生ConnectionException。详情如下:
详细信息:ErrorCode = RFC_OK。 ErrorGroup = RFC_ERROR_COMMUNICATION。 SapErrorMessage = SAP_CMINIT3:rc = 20>连接到SAP网关失败
Connect_PM GWHOST = IPAddress ,GWSERV = sapgw02,SYSNR = 02
使用Unicode
的本地主机上的LOCATION CPIC(TCP / IP)ERROR合作伙伴'IP地址'未到达
App.Config中的连接字符串是:
value="sap://CLIENT=643;SYSTEM ID=QSG;LANG=;@A/**IPAddress**/01"
value="sap://CLIENT=643;SYSTEM ID=QSG;LANG=;@A/**IPAddress**/02"
key="userid" value="UserName"
key="password" value="Password"
程序代码
SAPBinding binding = new SAPBinding();
//SAPBinding binding1 = Skelta.SAPConnector.SAPAdapter.SAPConnection.binding;
binding.ReceiveTimeout = TimeSpan.MaxValue;
binding.SendTimeout = TimeSpan.MaxValue;
binding.EnableBusinessObjects = true;
binding.EnableSafeTyping = true;
EndpointAddress address = new EndpointAddress(SAPConnectionString);
ChannelFactory<IRequestChannel> factory = new ChannelFactory<IRequestChannel>(binding, address);
// add credentials
factory.Credentials.UserName.UserName = SAPUserName;
factory.Credentials.UserName.Password = SAPPassword;
// Open client
factory.Open(TimeSpan.MaxValue);
//get a channel from the factory
irc = factory.CreateChannel();
//open the channel
try
{
irc.Open(TimeSpan.MaxValue);
}
请帮帮我