Question
· Jun 9, 2020

Cache Object Script AS2 EDI File Transfer

I want to receive an EDI file through Applicability Statement 2(AS2) transport and send back the acknowledgement to AS2 using Cache ObjectScript.

Previously I used to transfers the EDI files using FTP.

Can anyone please help on this.

Thanks in advance.

Discussion (3)0
Log in or sign up to continue

Hi MohanaPriya,

From what I read, AS2 is running on http or https. InterSystems Ensemble provides HTTP InboundAdapter and there is documentation that would help you build a custom Business Service: 

https://cedocs.intersystems.com/latest/csp/docbook/Doc.View.cls?KEY=EHTTP_preface
 

There is also support for EDIFACT documents:

https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=EACT_preface

You many need to customize your business service as I don't think there is direct support for AS2

I would strongly advise using Ensemble framework as a starting point as there would be much less coding involved. However, if this is not an option, you probably will need to proceed as follows:

1) Procure a Web Server that can support an AS2 protocol (I assume most Web Servers can do that and you most likely already have one). You would use SSL Certificates to authenticate the request if sent over https, which would be installed into the Trust Store of your Web Server (for Apache on Linux, it is just a file containing nothing but certs that look like hex characters).  I am not familiar with AS2 but I assume that you would probably need to activate a Web Server module for its support and there may be additional certs to install. The incoming requests will be forwarded to your Application Server

(This step is likely needed even if you were to use Ensemble)

2) Build  SOAP-based or REST-based Web Service that can receive http requests with attachments. If you can do all of the authentication on the Web Server, this Web Service will be running on your Application Server. It would simply need to process the request and read your attached EDI file. Here is the docs I found that might be helpful:

For SOAP: https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GSOAP_intro
For REST: https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GREST_services

3) Build business logic to parse the EDI file. This is where Ensemble comes in really handy because it likely already has an EDI parser.

I hope this helps... Maybe someone with more AS2 experience can comment on this thread.