cancel
Showing results for 
Search instead for 
Did you mean: 

Send DynamicConfiguration field to HTTP adapter header fields

Former Member
0 Kudos

Hi all,

I've this scenario: FlatFile1->PI7.0->HTTP

The message to be exchange is a pdf file. This file is sent successfully.

I'm using a HTTP receiver channel and I would like to send also the file name of pdf. This information is present on Dynamic Configuration.

How can I do it?

In the HTTP receiver channel there are the "_Header Fields_" parameter and the Adapter-Specific Message Attribute (_Apply HTTP Header Fields_).

Could I use them? How?

thanks

Regards

Daniele

Accepted Solutions (1)

Accepted Solutions (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Daniel,

Use Dynamic configuration and also enable ASMA in the communication channel of http receiver

>>In the HTTP receiver channel there are the "Header Fields" parameter and the Adapter-Specific Message Attribute (_Apply HTTP Header Fields_).

Could I use them? How?

Follow this link. This would give enough information

/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping

You have to do 2 things

1) Create Dynamic configuration code using UDF -


explained in the blog

2) USE ASMA fieids -- explained in the blog

Former Member
0 Kudos

Hi Baskar,

I think the blog is very usefull.

Only one doubt:

Currently, I have only created a configuration scenario that reads the PDF file and sends it via http (without interface mapping).

Based on the blog, I should create a mapping object to use the UDF to map the filename.

This way, will the pdf be maintained in the payload?

In the FILE sender channel, I have already configured the ASMA setting the FILENAME flag, so in the Dynamic Configuration I have the file name:

<? xml version = "1.0" encoding = "UTF-8" standalone = "yes"?>

- <! - Inbound Message

->

- <SAP: DynamicConfiguration xmlns: SAP = "http://sap.com/xi/XI/Message/30" xmlns: SOAP = "http://schemas.xmlsoap.org/soap/envelope/" SOAP: mustUnderstand = "1">

<SAP:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFTPHost"> 10.254.1.1:21 </ SAP: Record>

<SAP:Record namespace="http://sap.com/xi/XI/System/File" name="Directory"> /xxxxx/Invoice </ SAP: Record>

<SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileName"> file.pdf </ SAP: Record>

</ SAP: DynamicConfiguration>

Can I use this information directly in the HTTP receiver channel without creating mapping object?

thanks

regards

Daniele

stefan_grube
Active Contributor
0 Kudos

You can do it similar to this:

/people/stefan.grube/blog/2009/06/19/unknown-use-case-of-dynamicconfigurationbean-store-file-name-to-jms-header-without-mapping

You put the additional mudules in file sender adapter before the standard module.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Can I use this information directly in the HTTP receiver channel without creating mapping object?

yes you can do it. Please follow the Stefan's blog. It does as you need.

Note: getFileName method reads your source file name and setFileName method set the fileName for your taget side.

Standard adapter bean should appear after the dynamic configuration bean.

Former Member
0 Kudos

I've solved the problem following the Stefan's blog.

I've configured the Module Tab of FILE sender channel as follow:

Processing Sequence:

1. AF_Modules/DynamicConfigurationBean / Local Enterprise Bean / getFilename

2. AF_Modules/DynamicConfigurationBean / Local Enterprise Bean / setFilename

3. CallSapAdapter / Local Enterprise Bean / 0

Module Configuration:

getFilename / key.1 / write http://sap.com/xi/XI/System/File FileName

getFilename / value.1 / module.filename

setFilename / key.1 / read http://sap.com/xi/XI/System/HTTP HeaderFieldOne

setFilename / value.1 / module.filename

and the HTTP receiver channel as follow:

enable "Use Adapter-Specific message Attribute"

enable "Apply HTTP Header Fields"

thanks you very much

Daniele

Answers (1)

Answers (1)

stefan_grube
Active Contributor
0 Kudos

> I'm using a HTTP receiver channel and I would like to send also the file name of pdf. This information is present on Dynamic Configuration.

> How can I do it?

Could you explain, how you want to send the file name to receiver?

Based on this information we can discuss a solution.

henrique_pinto
Active Contributor
0 Kudos

>

> Could you explain, how you want to send the file name to receiver?

> Based on this information we can discuss a solution.

From the subject, I suppose she wants to send it via some HTTP Header.

@Daniele,

the blog linked above has pretty much everything you need.

Basically, you'd need an UDF in your mapping to do a conf.get() to get the FileName ASMA set by the sender file adapter and then do a conf.put() to add it to the HeaderFieldOne ASMA of the receiver HTTP Adapter.

BR,

Henrique.