none
ErrorCode=RFC_FAILURE. AdapterErrorMessage=An exception has occurred on the listener while executing RfcWaitForRequest..

    Question

  • Hi everyone,

    I get this error in the event log of BizTalk admin Console while I enable receive location of application deployed in it. I want to receive IDOC from SAP into my SQL database. 

    This is the entire error:

    Log Name:      Application
    Source:        BizTalk Server
    Date:          25-10-2016 14:54:58
    Event ID:      5740
    Task Category: BizTalk Server
    Level:         Warning
    Keywords:      Classic
    User:          N/A
    Computer:     ------------------
    Description:
    The adapter "WCF-Custom" 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)
       at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext& requestContext)".
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="BizTalk Server" />
        <EventID Qualifiers="32960">5740</EventID>
        <Level>3</Level>
        <Task>1</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2016-10-25T09:24:58.000000000Z" />
        <EventRecordID>14306760</EventRecordID>
        <Channel>Application</Channel>
        <Computer>-----------------</Computer>
        <Security />
      </System>
      <EventData>
        <Data>WCF-Custom</Data>
        <Data>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&amp; requestContext)
       at Microsoft.Adapters.Internal.LayeredChannelBindingElement.LayeredInboundChannel`1.System.ServiceModel.Channels.
       IReplyChannel.EndTryReceiveRequest(IAsyncResult result, RequestContext&amp; context)
       at System.ServiceModel.Dispatcher.ReplyChannelBinder.EndTryReceive(IAsyncResult result, RequestContext&amp; requestContext)
       at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext&amp; requestContext)</Data>
      </EventData>
    </Event>

    I have tried increasing the receive timeout binding property of the receive location to 23:59:59 and 24.20:31:23.6470000 against a default value of 00:10:00. Please help

    Thanks and Regards,

    Nidhin Nambiar

    Tuesday, October 25, 2016 9:48 AM

Answers

All replies

  • Hi Nidhin,

    Check out the Post by Sandro

    ErrorCode=RFC_FAILURE. AdapterErrorMessage=An exception has occurred on the listener while executing RfcWaitForRequest

    Also Refered from Ninos Blog:

    Exception = Details: ErrorCode=RFC_INVALID_HANDLE. AdapterErrorMessage=An exception has occurred on the listener while executing RfcWaitForRequest

    There are three reasons for this error type.

    First:

    You have a connection timeout on WCF-Custom binding port too low

    Second:

    This error occur because the SAP connection cannot resolve the BizTalk machine.
    To test this you must execute SM59 transaction on SAP and execute a test connection.

    And Third:

    You must include SAP property schemas using by SAP adapter in BizTalk.
    Do do that go under resources in you BizTalk Application and add new BizTalk Assembly.

    Now select Microsoft.Adapters.SAP.BiztalkPropertySchema.dll under DRIVE:Program FilesMicrosoft BizTalk Adapter Packbin

    ErrorCode = RFC_INVALID_HANDLE SAP WCF Adaper


    Mandar Dharmadhikari


    Tuesday, October 25, 2016 9:54 AM
    Moderator
  • Hi Nidhin

    How are you subscribing to this message from this ReceiveLocation? Make sure that there is a SendPort or orchestration started that can receive this message.

    Also, Can you please add "Microsoft.Adapters.SAP.BizTalkPropertySchema.dll" to the resources section of your Biztalk application? (as per this)

    Do note that this can be an authorization issue for the credentials you supplied in the ReceiveLocation. Check if you can connect to SAP using the same credentials from SAP GUI on a different machine.


    Thanks Arindam



    Tuesday, October 25, 2016 9:57 AM
    Moderator
  • Hi Mandar Dharmadhikari,

    I have seen the post already. It doesn't say anything about a perfect solution. One possibility is the receive timeout property ,which I have already tried out. The SAP guys are able to push IDOC and see a green status ,which means its getting pushed perfectly from SAP.

    Thanks and Regards,

    Nidhin Nambiar

    Tuesday, October 25, 2016 9:59 AM
  • Also enable tracing for the SAP adapter in BizTalk config file. Below post shows an example that will cause detailed events to be written to eventlogs-

    https://ninocrudele.me/2009/11/15/tracing-with-wcf-sap-adapter/


    Thanks Arindam

    Tuesday, October 25, 2016 10:05 AM
    Moderator
  • Hi Nidhin,

    Cool so you have ruled out the two of the three reasons..

    have you tried the the third solution as :

    You must include SAP property schemas using by SAP adapter in BizTalk.
    Do do that go under resources in you BizTalk Application and add new BizTalk Assembly.

    Now select Microsoft.Adapters.SAP.BiztalkPropertySchema.dll under DRIVE:Program FilesMicrosoft BizTalk Adapter Packbin

    Have you ruled out this option also??? And a Host Instance Restart after that??

    Regards,


    Mandar Dharmadhikari



    Tuesday, October 25, 2016 10:06 AM
    Moderator
  • Hello Nidhin,

    Did you deploy into BizTalk application, that contains receive port, assembly called Microsoft.Adapters.SAP.BiztalkPropertySchema.dll ? If not, you should do that in order to promote properties, contained in IDOC messages for instance.

    It may help you.

    Don't forget to activate EnableBizTalkCompatibilityMode property in wcf-sap adapter and restart services as well.


    Rachit Sikroria (Microsoft Azure MVP)

    Tuesday, October 25, 2016 10:07 AM
    Moderator
  • I have tried adding the Microsoft.Adapters.SAP.BiztalkPropertySchema.dll in the resources. But, the error prevails

    Thanks and Regards,

    Nidhin Nambiar

    Tuesday, October 25, 2016 10:31 AM
  • Hi Arindam Paul Roy,

    The credentials obtained from SAP are correct and according to the SAP guys, the id has got full authorization.

    I didn't understand your question regarding subscribing to the message.

    Thanks and Regards,

    Nidhin Nambiar

    Tuesday, October 25, 2016 10:35 AM
  • Hi Rachit Sikroria,

    I have kept EnableBizTalkCompatibilityMode property to true.

    Thanks and Regards,

    Nidhin Nambiar

    Tuesday, October 25, 2016 10:37 AM
  • I meant how will the message be processed once BizTalk receives it? At the minimum create a FILE SendPort with a filter on BTS.ReceivePortName to create a subscriber, and try enabling the ReceiveLocation again.

    Thanks Arindam


    Tuesday, October 25, 2016 11:06 AM
    Moderator
  • Hi Arindam Paul Roy

    I have used sapBinding of Consume Adapter Service in Visual Studio and got the SAP inbound schema's into my Visual Studio.

    Creating a table with the same columns as that of the sap schema's in SQL database, I have created a simple stored procedure that would insert the data that I get from SAP into my SQL database.
    Using sqlBinding, I got this procedure generated into my Visual Studio. Then, after creating Orchestration that would take input form the SAP schema and send it into my generated procedure, I successfully deployed it.
    In the admin Console, I have used pipelines as XMLTransmit and has provided the required details.

    But, I am not able to get the SAP data into my SQL database. I have used BAM to track the data, but even the deployed table in BAMPrimaryImport database is not updated,even after the SAP IDOC data is pushed.

    Thanks and Regards,

    Nidhin Nambiar

    Wednesday, October 26, 2016 6:11 AM
  • Hi Nidhin

    So, is this orchestration in Started state? Make sure that it shows as Started in Admin Console.

    BAM is not a great choice for debugging, so you should rely on event logs/BizTalk Admin console to debug operational issues such as this.

    Have you tried the rest of the troubleshooting steps shared on this thread?


    Thanks Arindam

    Wednesday, October 26, 2016 6:35 AM
    Moderator
  • But, I am not able to get the SAP data into my SQL database. I have used BAM to track the data, but even the deployed table in BAMPrimaryImport database is not updated,even after the SAP IDOC data is pushed.

    can you elaborate on this..this should not be the primary concern ..have you made sure that Biztalk is receiveing the idoc messages??

    Regards


    Mandar Dharmadhikari

    Wednesday, October 26, 2016 6:44 AM
    Moderator
  • Hi Arindam Paul Roy,

    I have checked Admin Console event logs for windows application. It shows me the above stated error.

    When I checked tracked service instances, I found that the BizTalk Server Application was terminated on 20th and the IDOC that was are being sent are after 24th. i.e BizTalk has not received any message from SAP. At the same time, when the IDOC is sent from SAP, a green status is obtained at the SAP side, which means the data is successfully sent from SAP. But, it doesn't mean that the data is sent to BizTalk. Thats what I am concerned about. How could I track this interface?

    Hi Mandar Dharmadhikari,

    I had deployed the excel .xml file,containing the schema, so that it gets reflected into BAMPrimaryImport database. Which means, if the data is pushed from SAP, even if it doesn't reflect into Database say xyz, it should atleast get reflected in BAM database.In my case, it doesn't. May be BAM is not the correct method of debugging.

    Thanks and Regards,

    Nidhin Nambiar

    Friday, October 28, 2016 6:05 AM
  • Hi Nidhin

    Are you still getting the error in eventviewer?

    I would suggest enabling WCF-SAP adapter tracing as I suggested earlier and then trigger the IDoc from SAP-

    Also enable tracing for the SAP adapter in BizTalk config file. Below post shows an example that will cause detailed events to be written to eventlogs-

    https://ninocrudele.me/2009/11/15/tracing-with-wcf-sap-adapter/


    Thanks Arindam

    Friday, October 28, 2016 6:19 AM
    Moderator
  • Hi Nidhin,

    I had deployed the excel .xml file,containing the schema, so that it gets reflected into BAMPrimaryImport database. Which means, if the data is pushed from SAP, even if it doesn't reflect into Database say xyz, it should atleast get reflected in BAM database.In my case, it doesn't. May be BAM is not the correct method of debugging.

    >> WellBAM can be used for debugging just on the high level but it is not meant for debugging as such its main purpose is to track key business data..Now if the data is not getting populated in BAMprofile can be due to different reasons..anmd you should not use to debug it in this case..

    Now that being said as Arindam pointed out enable tracning for the wcf sap adapter in Biztralk that can give you somemore idea into what exactly ishappening, you cen refer

    BizTalk Server: WCF-Based SAP Adapter and Troubleshooting by Mandi Anez Ohlinger [MSFT]

    In Addition, You can refer to the Article by Nino,

    Tracing with WCF SAP adapter

    This will help you to understand , if the IDOC is actually reaching to Biztalk or getting lost...

    Next step would be as Sandro Pointed out in his post that network packets between the SAP system and the Biztalk system needs to be analyzed to understand the issue in more depth.


    Regards,


    Mandar Dharmadhikari

    Friday, October 28, 2016 6:39 AM
    Moderator
  • Hi Mandar Dharmadhikari,

    Is there any prerequisites for using WCF tracing?  I have added the configuration changes as mentioned by 'nino'

    Thanks and Regards,

    Nidhin Nambiar

    Wednesday, November 2, 2016 11:20 AM
  • If you have added the entries as required, then just a Host Instance restart should suffice. Keep referring the event viewer

    Regards,


    Mandar Dharmadhikari


    Wednesday, November 2, 2016 11:22 AM
    Moderator
  • Hi Ed Price - MSFT

    I would appreciate some useful tips from your side. In case you know how to proceed,please help

    Thanks and Regards,

    Nidhin Nambiar

    Wednesday, November 2, 2016 11:22 AM
  • Hi everyone,

    Also can someone suggest where can I find SAPRFC.INI?

    It seems like I have some dependency on this file.

    'SapErrorMessage=Open file 'saprfc.ini' failed: 'No such file or directory'.  AdapterErrorMessage=Error accepting incoming connection. RfcAccept returned RFC_HANDLE_NULL..'


    Monday, November 7, 2016 8:51 AM
  • Hi Nidhin,

    Refer the blog post by Kent Weare as mentioned below...have you tried that solution??

    SAP calling RFC hosted in BizTalk

    Regards


    Mandar Dharmadhikari

    Monday, November 7, 2016 8:58 AM
    Moderator
  • Monday, November 7, 2016 9:07 AM
    Moderator
  • Its generic SAP Listener error. Can you please check with basis guy that the user have right privileges for that IDOC transaction which u r using having inside biztalk or not. 

    Ram

    Monday, November 7, 2016 6:15 PM