The adapter “WCF-SAP” raised an error message. Details “System.ServiceModel.CommunicationObjectFaultedException: The communication object, Microsoft.Adapters.Internal.LayeredChannelBindingElement.LayeredInboundChannel cannot be used for communication because it is in the Faulted state.

  • Sandro Pereira
  • Feb 6, 2015
  • 4 min read

In the last few weeks, I have been playing around with the WCF-SAP adapter. I have many things to write about in terms of installation, configuration, communication, and so on, but I will start with this topic/problem.

While trying to create a WCF-SAP Receive port to be able to listener incoming IDOC from the SAP system and despite the receive location be and stay enable in the BizTalk Administration Console I soon realized that the documents were not being picked up by BizTalk.

When I consulted the Event Viewer to check if there was additional information about the causes that were happening, I found these three warning messages:

“The adapter “WCF-SAP” raised an error message. Details “System.ServiceModel.CommunicationObjectFaultedException: The communication object, Microsoft.Adapters.Internal.LayeredChannelBindingElement.LayeredInboundChannel`1[System.ServiceModel.Channels.IReplyChannel], cannot be used for communication because it is in the Faulted state.
at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Close()
at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.Close()”.

“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.”

“The adapter “WCF-SAP” raised an error message. Details “Microsoft.Adapters.SAP.RFCException: Details: ErrorCode=RFC_FAILURE. AdapterErrorMessage=An exception has occurred on the listener while executing RfcWaitForRequest..
at Microsoft.ServiceModel.Channels.Common.Design.AdapterAsyncResult.End()
at Microsoft.ServiceModel.Channels.Common.Channels.AdapterReplyChannel.EndTryReceiveRequest(IAsyncResult result, RequestContext& requestContext)
at Microsoft.Adapters.Internal.LayeredChannelBindingElement.LayeredInboundChannel`1.
System.ServiceModel.Channels.IReplyChannel.EndTryReceiveRequest(IAsyncResult result, RequestContext& context)
at System.ServiceModel.Dispatcher.ReplyChannelBinder.EndTryReceive(IAsyncResult result, RequestContext& requestContext)”

BizTalk Server WCF SAP Adapter Event Viewer warnings

📝 One-Minute Brief

When a BizTalk WCF-SAP Receive Location stays enabled but fails to pick up IDOCs, you may see a “CommunicationObjectFaultedException” in the Event Viewer. This generic error often masks a permission issue on the SAP side. While your BizTalk configuration may be correct, you likely need the SAP team to authorize the BizTalk Server’s Program ID on the SAP Gateway.

Cause

Well. Unfortunately, these errors are generic error messages and do not provide what the real problem is.

So my advice is to first check all the port configurations for any possible configuration mistakes. After that, you should use external network tools that let you dig deep into network traffic and inspect individual packets, for example, Wireshark.

In this particular case, I found that the BizTalk Server didn’t have the proper authorization to connect with that particular SAP program id:

ERR*.1.registration of tp [PROGRAM ID] from host [BIZTALK SERVER] not allowed.720.SAP-Gateway.721.2.gwxxrd.c.3644..Thu Feb  5 18:46:11 2015….33844.SAP-Gateway on host [SAP SERVER] / [GWServer]…..*ERR*.

BizTalk Server WCF SAP Adapter wireshark monitoring

Solution

Unfortunately, I’m not an SAP expert, and I don’t know exactly what to do in SAP. What I can tell you is that there is nothing wrong with your configuration; this is not a BizTalk problem. What I could see in one of the SAP tools was that BizTalk was trying to connect, but it was disconnected straight away.

So, to solve this problem, you must contact your SAP team to properly configure the access. Once it is done, everything will work fine, at least in this case, it solved my problems.

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. 

Thanks for Buying me a coffe
Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

4 thoughts on “The adapter “WCF-SAP” raised an error message. Details “System.ServiceModel.CommunicationObjectFaultedException: The communication object, Microsoft.Adapters.Internal.LayeredChannelBindingElement.LayeredInboundChannel cannot be used for communication because it is in the Faulted state.”

  1. Hi Sandro,
    I actually faced the same issue with the exact same error message. However, the way I used to find the error was different. I enabled the RfcSdkTrace in the WCF-SAP port configuration and was able to see all the traces. It’s good to know that we can also use WireShark to troubleshoot this kind of issues.

Leave a Reply

Your email address will not be published. Required fields are marked *

The Ultimate Cloud
Management Platform for Azure

Supercharge your Azure Cost Saving

Learn More
Turbo360 Widget

Back to Top