cancel
Showing results for 
Search instead for 
Did you mean: 

Read content disposition attachment filename

ADIDAS
Participant
0 Kudos
1,753

Hi,

I have a scenario where I am getting data from a SOAP HTTP Service and need to create a file from the data that is inside the Payload. The challenge I am running into is with the filename. The SOAP Service is putting the filename of the file to be created in the header content-disposition field (attachment; filename="XXXXXXX.xml").

I have turned on the "Adapter Specific Message Attribute" in the SOAP Sender channel and getting the value in XHeaderName1 = CONTENT DISPOSITION) . The filename value also show up the Dynamic Configuration of the SOAP header when i check in SXMB_MONI. But I am unable to get the value from the Dynamic Configuration in the UDF that i have put in the message Mapping such that i can use it to create the filename.

The Dynamic Configuration shows me a value of

<SAP:Record namespace="http://sap.com/xi/XI/System/SOAP" name="SHeaderCONTENT-DISPOSITION">attachment; filename="attachment; filename="XXXXXXXXXX.xml"</SAP:Record>

Has anyone grabbed the name from content disposition in the UDF.

Regards,
Arunava

Accepted Solutions (0)

Answers (1)

Answers (1)

vicky20691
Active Contributor
0 Kudos

Hi,

I suggest you to put screenshots while posting questions. I have doubt on the following

Doubtful on the above. It should have been

<"http://sap.com/xi/XI/System/SOAP", name="SHeaderCONTENT-DISPOSITION">attachment;filename="XXXXXXX.xml"

So hope you can give screenshot of this or verify this.

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create(“http://sap.com/xi/XI/System/SOAP“,”SHeaderCONTENT-DISPOSITION”);

String attFileName= conf.get(key);

//attFileName = attachment;filename="XXXXXXX.xml"

int start = attFileName.indexOf("=");

int end= attFileName.length();

String fileName = attFileName.substring(start+1,end);

return fileName;

Regard,

Vikas