IBM Support

AS2 file transfers with mailboxing using the original file name

Technical Blog Post


Abstract

AS2 file transfers with mailboxing using the original file name

Body

How to send the original file name when using Sterling Integrator (SI) AS2 with mailboxing for outbound file transfers?

This is a question that arises often by customers using AS2 in SI, so I thought this can be a good subject for a blog entry, specially when mailboxing is used for the payload storage.

When using SI AS2 for outbound file transfers, the system generates a machine generated file name like per example:

MOKOsi228627147e925eebbnode13SIprod.si3si.

Customers and\or partners might have the need to use the original file name instead.

In order for the original file name to be sent in the AS2 header of the file being transferred, you can do the following:

  1. File system storage

If you are using the file system to store the payload, this is simply a question of setting the correct parameter on the AS2 relationship created for this transfer.

image

Once the option "include File Name In Message" is set, the original file name will be send in the AS2 header of the message during transfer and the remote partner can use it to save the message in his local system.

2. Mailbox storage.

If you are using mailboxing for the payload, then the option above is no longer available and you need to implement the workaround described below to have the original file name being sent

Workaround: Find the AS2 system Business Process (BP) that you are using for outbound file transfers with mailboxing, it should be the BP containing the operation EDIINTPipelineBuild service, depending on the implementation and on the configuration of the AS2 partner profile, different BPs can be used like per example MailboxAS2SendSyncMDN or MailboxAS2SendAsyncMDN.

Within the BPML of that BP find the operation that uses the EDIINTPipelineBuild service configuration.

<operation name="Messagebuild">

<participant name="EDIINTPipelineBuild"/>

<output message="noopout">

<assign to="." from="*"></assign>

<!--We need to assign a contract id we looked up-->

<!--<assign to="b2b-contract-id" from="ContractLookup/OutboundContract/OUT_CONTRACT_ID/text()"></assign>-->

<assign to="Action">build</assign>

<assign to="EDIINTIncludeFileName" from="KeepFileNameParm/text()"></assign>

</output>

<input message="noopin">

<assign to="." from="*"></assign>

</input>

</operation>

You will need to replace that operation with the following:



<--Use the Get document info service to assign a BodyName to the mailbox message, this is required since the EDIINTPipeline build service uses the BodyName to set the file name on the AS2 header-->



<operation name="Get Document Information Service">

<participant name="GetDocumentInfoService"/>

<output message="GetDocumentInfoServiceTypeInputMessage">

<assign to="." from="*"></assign>

<assign to="BodyName" from="//ExtractBeginResults1/MessageName/text()"></assign>

<!--Note that the xpath for the BodyName assign might differ depending on the BP being used, check the process data of one of the BP executions to see which path contains the correct original file name-->

</output>

<input message="inmsg">

<assign to="DocInfo">*</assign>

</input>

</operation>



<--modify the EDIINT Pipeling Build service and add the parameter to include the file name in the AS2 header-->



<operation name="EDIINT Pipeline Service">

<participant name="EDIINTPipelineBuild"/>

<output message="EDIINTPipelineServiceInputMessage">

<assign to="." from="*"></assign>

<assign to="Action">build</assign>

<assign to="EDIINTIncludeFileName">true</assign>

</output>

<input message="inmsg">

<assign to="." from="*"></assign>

</input>

</operation>



<--Use the release service to remove the node in process data created by the Get Document Info service-->



<operation name="Release Service">

<participant name="ReleaseService"/>

<output message="ReleaseServiceTypeInputMessage">

<assign to="." from="*"></assign>

<assign to="TARGET">DocInfo</assign>

</output>

<input message="inmsg">

<assign to="." from="*"></assign>

</input>

</operation>

Note: Once the workaround implemented, the original file name will be sent for all partners using the same AS2 transfer method associated with the BP you have modified, Sync, Async or No MDN.

If you have additional question regarding this implementation or need help implementing it, please raise a PMR with IBM sterling integrator support.

If you have something that could be interesting to add on this topic, please leave a comment.

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SS3JSW","label":"IBM Sterling B2B Integrator"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

UID

ibm11122051