Error: “Safe handle has been closed” when receiving a response message on a SOAP port.

One of the customers was working on BizTalk Server 2010. The BizTalk databases were hosted on SQL Server 2008 R2. He was getting the below error when he gets a response to a SOAP adapter for one of his applications:

"A response message sent to adapter "SOAP" on receive port "ReceiveCreateUserProfile" with URI
"/xxxxxx.BizTalk.CreateUserProfile/xxxxxx_BizTalk_CreateUserProfile_CreatePOUserProfile_CreateUserProfile_WebServicePort.asmx" is suspended.

Error details: Safe handle has been closed

1. The issue was with the BackupBizTalkServer job not being configured and enabled. Followed
the mentioned below steps.

   a. Collected the MessageBoxViewer report
   b. It showed database throttling
   c. The jobs MessageBox_Message_ManageRefCountLog_BizTalkMsgBoxDb and BackupBizTalkServer were disabled
   d. Configured the job BackupBizTalkServer and enabled it (Refer
. Enabled the job MessageBox_Message_ManageRefCountLog_BizTalkMsgBoxDb
   f. Collected a fresh MessageBoxViewer report and it did not show database throttling this time 

2. In another case there were issues with the DTAPurgeAndArchive job where the tracking spool table was very heavy. In this case, follow the mentioned below steps.

   a. Collected the MessageBoxViewer report
   b. Tracking spool table had hug number of rows.
   c. Reduced the number of ‘Harddays’ the data is kept in the database for the DTAPurgeAndArchive job.
   d. Once you clear the DTADB dta_DebugTrace and dta_MessageInOutEvents tables, the spool table will catch up and so will the SOAP adapter.
   e. Terminated all the suspended instances from the BizTalk MMC.

a. Increase the frequency of the Purge and Archiving job if required

   b. Terminator tool can also be used to get rid of the suspended instances, caching instances, DTA Orphaned instances and the DTA mark log rows.
       You can download the terminator tool from
       BizTalk terminator download and install information available at :
       Using BizTalk Terminator to resolve issues identified by BizTalk MsgBoxViewer and the BizTalk 2010 Monitor BizTalk Server Job :

Configure "Max Degree of Parallelism for MsgBoxDB Servers" to ‘1’ as required by BizTalk (Refer if it is not already set to 1

Note : The SOAP adapter is deprecated in BizTalk Server 2010. You should use the WCF-BasicHttp to communicate with Web services and clients that conform to the WS-I Basic Profile 1.1. To communicate with Web services and clients that conform to WS-*, use the WCF-WSHttp adapter.
Refer .

Written by:
Kshitij Dattani

Reviewed by:
Jainath Ramanathan

Microsoft GTSC India

Comments (1)

  1. SK says:

    In this case the user who configured BizTalk has used his own user name as the owner of jobs and his account was removed from AD after he left the job. I told to DBA to change the job owner to service account.

Skip to main content