Recently, one of my clients migrated one of their SAP systems, and after that intervention, the BizTalk receive location that was listening in a specific Program ID started to fail with the following error message present in the event viewer:
- RFC IDOC_INBOUND_ASYNCHRONOUS could not be resolved against the SAP system because its metadata could not be obtained.
Full error message:
The adapter “WCF-Custom” raised an error message. Details “Microsoft.ServiceModel.Channels.Common.MetadataException: RFC IDOC_INBOUND_ASYNCHRONOUS ᖚイ楸 could not be resolved against SAP system because its metadata could not be obtained. —> Microsoft.Adapters.SAP.RFCException: Details: ErrorCode=RFC_EXCEPTION. ErrorGroup=RFC_ERROR_APPLICATION_EXCEPTION. SapErrorMessage=EXCEPTION FU_NOT_FOUND RAISED. AdapterErrorMessage=An error occurred while determining the function interface of the RFC IDOC_INBOUND_ASYNCHRONOUS ᖚイ楸.
at Microsoft.Adapters.SAP.RFCException.HelperThrow(Int32 retCode, String additionalErrorMessage)
at Microsoft.Adapters.SAP.RfcClientConnection.GetRfcFunctionInterface(String rfcName)
at Microsoft.Adapters.SAP.InternalRfcMetadata..ctor(String originalRfcName, SAPConnection sapConnection)
at Microsoft.Adapters.SAP.SAPMetadataContract.ResolveOperationMetadata(String operationId, TimeSpan timeout, TypeMetadataCollection& extraTypeMetadataResolved)
at Microsoft.ServiceModel.Channels.Common.Design.MetadataCache.GetOperationMetadata(String uniqueId, Guid clientId, TimeSpan timeout)
at Microsoft.Adapters.SAP.SapFunctionMetadata.ResolveOperationMetadataUsingSdk(String absoluteName, String displayName, String funcName, String operationNamespace, SAPConnection sapConnection, Boolean isTrfc, MetadataLookup metadataLookup, TimeoutHelper timeoutHelper)
— End of inner exception stack trace —
at Microsoft.ServiceModel.Channels.Common.Design.AdapterAsyncResult.End()
at Microsoft.ServiceModel.Channels.Common.Channels.AdapterReplyChannel.EndTryReceiveRequest(IAsyncResult result, RequestContext& requestContext)
at System.ServiceModel.Dispatcher.ReplyChannelBinder.EndTryReceive(IAsyncResult result, RequestContext& requestContext)
at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext& requestContext)”.
Of course, followed by the generic warning messages:
The adapter “WCF-Custom” raised an error message. Details “Microsoft.Adapters.SAP.RFCException: Details: ErrorCode=RFC_INVALID_HANDLE. AdapterErrorMessage=An exception has occurred on the listener while executing RfcWaitForRequest..”.
The adapter “WCF-Custom” raised an error message. Details “System.ServiceModel.CommunicationObjectFaultedException: The communication object, Microsoft.ServiceModel.Channels.Common.Channels.AdapterReplyChannel, cannot be used for communication because it is in the Faulted state.”.
The adapter “WCF-SAP” raised an error message. Details “The WCF service host at address “sap://CLIENT=[SAPClientID];LANG=[LANG];@A/[SAPServer]/[SystemID]?ListenerGwServ=[GWServer]&ListenerGwHost=[GwHost]&ListenerProgramId=[ProgID]&RfcSdkTrace=True&AbapDebug=False” has faulted and as a result no more messages can be received on the corresponding receive location. To fix the issue, BizTalk Server will automatically attempt to restart the service host.”
However, this time Wireshark didn’t provide me additional information to help me diagnose and solve the problem.
📝 One-Minute Brief
After an SAP system migration, a BizTalk receive location using WCF-SAP may fail with “RFC IDOC_INBOUND_ASYNCHRONOUS could not be resolved… metadata could not be obtained.” The fix is typically to verify the RFC destination in SM59 and ensure the Unicode/Character Width settings match (switching from non-Unicode to Unicode resolved it in this case).
Cause
Well, I’m not a “SAP expert” nor do I have the intention to become one; I only want to know and understand the basics, so I can properly diagnose and resolve the different problems that may arise.
In this case, and sorry if I’m not giving all the precise technical details, the root cause of this problem is related to the Encoding type of the RFC Connection – Non-Unicode or Unicode (you may see the differences between them here).
Solution
You should keep these SAP transaction names in mind: SALE, SM59, WE20, WE21, and WE02. As my dear friend Nino Crudele mentioned in one of his posts, “In SAP exist thousands of transactions, the most important for us are SALE, SM59, WE20, WE21, WE02.”
In this particular problem, you should use an SM59 transaction to check if all the configurations are set correctly, like the message type, program ID, the channel, and so on… but especially the Unicode settings
From that, you should do the following macro steps:
- Launch SAPGUI and log in to the SAP System.
- Execute the SM59 (Display and maintain RFC destinations) transaction.
- Select the TCP/IP Connections option and pick the RFC destination that we are using.
- Go to special options and check the Character Width in Target System in the Unicode tab.

Make sure the Unicode option is selected; otherwise to contact your SAP team, and they must ensure that the RFC Connection is properly configured to use Unicode.
In my case, changing the RFC Connection from non-Unicode to Unicode solved the problem that we were facing.
Hope you find this helpful! If you liked the content or found it useful and would like to support me in writing more, consider buying (or helping to buy) a Star Wars Lego set for my son.
awesome! this kind of error it’s not easy to debug ! congrats!
You are the man Sandro. Thanks!
Hello, I had the same kind of issue
ErrorCode=RFC_EXCEPTION. ErrorGroup=RFC_ERROR_APPLICATION_EXCEPTION. SapErrorMessage=EXCEPTION OBJECT_UNKNOWN RAISED. AdapterErrorMessage=Error returned by RfcCallReceiveEx while calling RFC: IDOCTYPE_READ_COMPLETE..
Because metadata were truncated in the adapter. I solved this issue by reading your article and set the RFC Destination as unicode.
Thank you very much