AIF FILE SYSTEM ADAPTER INBOUND PROCESS ERROR

Hi All,

I am working with AIF in AX 2012 R2 CU6 and have developed a web service to create records in an intermediate table and then process those records to match with the PO’s in the system and carry out the functionality of Splitting PO lines based on delivery date which comes in File(Adapter used is FILE SYSTEM ADAPTER). The processing of the lines is right after the file has been imported, which means its in the updatenow() method of AXD Class.

This services works fine for 5-10 records but if the file is big(like 1400-1500 lines) it gives me timeout error for the service.

I did some research and changed the timeout period of the service to almost 2 hours but still I am facing the same issue.

Is there any limit on file size that can be used for AIF??

Below is the error what I am facing

The request failed with the following error: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was ‘01:50:01’. The read operation failed, see inner exception. The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was ‘01:50:01’. An existing connection was forcibly closed by the remote host OGSPurchDlvSched OGSPurchDlvSched_external Inbound Error {9A5825B8-7255-4A58-8648-DD891722A845} None The request failed with the following error: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was ‘01:50:01’. The read operation failed, see inner exception. The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was ‘01:50:01’. An existing connection was forcibly closed by the remote hostView the exception log for more details”

Can anyone suggest an approach that I should have to resolve this error??

I’m confused because you talk about a web service and adapter-based communication in the same time.

If it’s based on an adapter, is it the AIFGatewayReceiveService batch that throws the error? (If it’s the case, you don’t have to care about your code in the Axd class, because the process fails before it can be called).

If it’s a web service, you have to set timeouts for both the client and server side. See Timeouts in WCF and their default values for details.

If it doesn’t help, please explain what exactly you’re doing.

Hi Martin,

Thank you for the reply. Let me explain you what I have done. I have used the standard AXD document wizard for creating a document along with service and I have created a enhanced inbound port with adapter as FILE SYSTEM ADAPTER. When I run the AIFGatewayReceiveService it gives me the error as mentioned earlier.

What you said in your parallel thread sounds more like the error is caused by AIFInboundProcessingService, not AIFGatewayReceiveService, because it’s AIFInboundProcessingService that process the document. Where is the error logged? Can you show a complete call stack?

Hi Martin,

Sorry you are correct it’s AIFInoundProcessingService. This is the error which is logged in the exceptions form of AIF

The request failed with the following error: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was ‘00:00:59.9843709’. The read operation failed, see inner exception. The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was ‘00:00:59.9843709’. An existing connection was forcibly closed by the remote host.

All right, so it means that the problem has nothing to do with a file or the File System Adapter - you have a problem in a batch in AX (that reads data from AIF queue in database).

You should to find which connection got interrupted. Understanding where the error is thrown may help with it. Use the debugger or tracing. You may want to check Event Log and SQL Server logs too.

Aha, I probably see the answer in information that mentioned in the Dynamics Community forum. Because of a bug in your code, the batch would never finish.

Hi Martin,

I have already updated the method to handle that scenario… Here are the changes that I have done to that particular method.

///

/// Performs the business logic triggered by pressing the OK button on the delivery schedule form.

///

///

/// true if the form should be closed; otherwise, false.

///

boolean updateSchedule()

{

boolean ret = false;

boolean agreementDisassociationNeeded = this.checkAgreementDisassociation();

// Your changes break constrains of the referenced Agreement. Do you want to disassociate the Delivery Schedule from the Agreement?

if (xSession::isCLRSession())

{

this.updatePurchLineTable(agreementDisassociationNeeded);

ret = true;

}

else

{

if (!agreementDisassociationNeeded

|| Box::yesNo("@SYS138463", DialogButton::No) == DialogButton::Yes)

{

this.updatePurchLineTable(agreementDisassociationNeeded);

ret = true;

}

}

return ret;

}

Thank you