I have a problem with the SAP NCO 3.0. After the connection is established and the SAP System send an IDoc to my Server implementation, the NCO raised the following exception:
SAP.Middleware.Connector.RfcServerApplicationException: Uncaught exception SAP.Middleware.Connector.RfcUnsupportedPartnerException thrown in SAP.Middleware.Connector.RfcServer.ARfcDestShipImp when executing RFC server function ARFC_DEST_SHIP ---> SAP.Middleware.Connector.RfcUnsupportedPartnerException: Non-ABAP RFC client (partner type ) not supported at SAP.Middleware.Connector.RfcConnection.ReadUpTo(RFCGET readState, RfcFunction function, RFCID toRid) at SAP.Middleware.Connector.RfcConnection.Dispatch() at SAP.Middleware.Connector.RfcTransaction.Playback() at SAP.Middleware.Connector.RfcServer.ARfcDestShipImp(RfcServerContext ctx, IRfcFunction func) at SAP.Middleware.Connector.RfcServer.InvokeServerFunction(RfcConnection conn, ServerFunctionInfo serverFuncInfo, RfcServerFunction functionImp)
Function implementation:
class RfcFunctionImpl
{
[RfcServerFunction(Name = "STFC_CONNECTION", Default = false)]
public static void StfcConnection(RfcServerContext serverContex, IRfcFunction rfcFunction)
{
string dataFileName = string.Format("{0}.idoc", serverContex.TransactionID);
FileStream dataFile = new FileStream(dataFileName, FileMode.OpenOrCreate, FileAccess.Write);
StreamWriter writer = new StreamWriter(dataFile);
IRfcTable iDoc = rfcFunction.GetTable("IDOC_DATA_REC_40");
foreach (IRfcStructure record in iDoc)
{
for (int i = 0; i < record.Count; i++)
{
if (i == record.Count - 1)
writer.WriteLine(record.GetString(i));
else
writer.Write("{0};", record.GetString(i));
}
}
writer.Flush();
dataFile.Close();
}
[RfcServerFunction(Default = true)]
public static void GrDestAKLEllipta(RfcServerContext serverContex, IRfcFunction rfcFunction)
{
string dataFileName = string.Format("{0}.idoc", serverContex.TransactionID);
FileStream dataFile = new FileStream(dataFileName, FileMode.OpenOrCreate, FileAccess.Write);
StreamWriter writer = new StreamWriter(dataFile);
IRfcTable iDoc = rfcFunction.GetTable("IDOC_DATA_REC_40");
foreach (IRfcStructure record in iDoc)
{
for (int i = 0; i < record.Count; i++)
{
if (i == record.Count - 1)
writer.WriteLine(record.GetString(i));
else
writer.Write("{0};", record.GetString(i));
}
}
writer.Flush();
dataFile.Close();
}
}
I've tried different implementations, but nothing helps.
I hope someone can help me!
Regards Thorsten